[info-performer] Cliptexture and PFTEX_WRAP

Date view Thread view Subject view Author view

From: Manuel Pérez Aixendri (Manuel.Perez-Aixendri++at++uv.es)
Date: 09/21/2004 04:57:58


I’m working with a cliptexture mapped on a sphere. This is my problem: I
have a pfGeoset with the cliptexture. When I set the PFTEX_WRAP with
PFTEX_REPEAT, the setCenter function does’nt work correctly. It seems like
the center is translated to the right and to the bottom and I can’t set
values greater than the virtualclipsize to the function setCenter. If I
doesn’t repeat the texture, it works fine, but I need to repeat it. Im
working with IRIX Performer 3.0 and 1 pipe.
This is my code:

if(!(clip = pfdLoadClipTexture(fileName)))
{
                    pfNotify(PFNFY_WARN, PFNFY_PRINT, "clip map
incorrecto\n");
                    return NULL;
}
clip->setName(fileName);
 //clip->setRepeat(PFTEX_WRAP,PFTEX_REPEAT);    //If this line is
uncommented the setCenter doesn’t works
mpcliptex = new pfMPClipTexture();
mpcliptex->setClipTexture(clip);
pfuAddMPClipTextureToPipes(mpcliptex,pfGetPipe(0),NULL);
for (i=0;i<pfGetMultipipe();i++)
    {
       pfGetPipe(i)->addMPClipTexture(mpcliptex);
       pfGetPipe(i)->setIncrementalStateChanNum(1);
    }
 /* set up geo state */
pfMaterial  *material = new pfMaterial();
 material->setColor(PFMTL_AMBIENT,  0.6f, 0.6f, 0.6f);
 material->setColor(PFMTL_DIFFUSE,  0.6f, 0.6f, 0.6f);
 material->setColorMode(PFMTL_FRONT, PFMTL_CMODE_OFF);
 gstate = new pfGeoState;
 gstate->makeBasic();
 gstate->setMode(PFSTATE_CULLFACE, PFCF_OFF);
 gstate->setMode(PFSTATE_ENLIGHTING, PF_ON);
 gstate->setMode(PFSTATE_ENTEXTURE, PF_ON);
 gstate->setAttr(PFSTATE_FRONTMTL, material);
 gstate->setAttr(PFSTATE_BACKMTL, material);
 gstate->setAttr(PFSTATE_TEXTURE, clip);
 

            Thanx in advance


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Sep 21 2004 - 05:00:59 PDT