texture problem

New Message Reply Date view Thread view Subject view Author view

Torrey Stevens (stevens++at++flanders.tempe.gtegsc.com)
Thu, 30 May 1996 10:54:45 -0700


Hello,
I seem to be having a new problem.
I am trying to texture a rectangular face with a two component IA texture but
view the face the texture comes up not aligned to the face and when I rotate the
face the texture appears to rotate differently within in the face.
The face was created with MultiGen and I am running on a Onyx.

Here is the code using C++ with Performer 2.0:

   pfVec2 tcoords[4];
    
   tcoords[0].set(0.0, 1.0);
   tcoords[1].set(1.0, 1.0);
   tcoords[2].set(1.0, 0.0);
   tcoords[3].set(0.0, 0.0);

   tex = new(pfGetSharedArena()) pfTexture;
   tev = new(pfGetSharedArena()) pfTexEnv;

    tex->setImage((uint*)image, 2, 32 , 32, 0);
// image contains values 0x00ff or 0ff00

    tex->setFilter(PFTEX_MINFILTER, PFTEX_BILINEAR);
    tex->setFilter(PFTEX_MAGFILTER, PFTEX_BILINEAR);

    tex->setFormat(PFTEX_FAST_DEFINE, PF_ON);
    tex->setFormat(PFTEX_INTERNAL_FORMAT, PFTEX_IA_8);
    tex->setFormat(PFTEX_EXTERNAL_FORMAT, PFTEX_PACK_8);
   gstate = new pfGeoState;
   gstate->setMode(PFSTATE_ENTEXTURE, PF_ON);
   gstate->setAttr(PFSTATE_TEXENV, tev);
   gstate->setAttr(PFSTATE_TEXTURE, tex);
   gstate->setMode(PFSTATE_TRANSPARENCY, PFTR_ON);

   gset = geode->getGSet(0);
   gset->setAttr(PFGS_TEXCOORD2, PFGS_PER_VERTEX, tcoords, NULL);
   gset->setGState(gstate);

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Note: geode is the face being textured.

When viewing the face, the transparency does not seem to work either.

If anyone has any ideas please let me know.....

Thanks,
Torrey
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer.html
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:56 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.