Garrett Williams (gwilliams++at++etcflorida.com)
Thu, 30 Oct 1997 06:28:46 -0800
The following is a verry simple demo and there are many other options
that can be included but this should get you started...
/* create texture enviorment */
Tev = pfNewTEnv(NULL);
/* set it to show through back ground color */
pfTEnvMode(Tev,PFTE_MODULATE);
/*PFTE_DECAL = texture color only and not effected by timeofday */
/* create texture and load */
texture = pfNewTex(NULL);
pfLoadTexFile(texture,"grass.rgb");
/* create state */
State = pfNewGState(NULL);
/* main key to one texture over large area of polies */
/* create texture generation this maps the texture to polies for you */
Tgen = pfNewTGen(NULL);
pfGStateMode(State,PFSTATE_ENTEXTURE, PF_ON); /* enable textures */
pfGStateAttr(State,PFSTATE_TEXTURE,texture); /* set texture to node */
pfGStateAttr(State, PFSTATE_TEXENV,Tev); /* set texture enviorment */
pfGStateMode(State,PFSTATE_ENTEXGEN, PF_ON);/* use TGen for texture
maping */
pfGStateAttr(State,PFSTATE_TEXGEN,Tgen); /* set what TGen to use */
pfTGenPlane(Tgen,PF_S,1.0f,0.0f,0.0f,0.0f); /* repeate in x smaller=more
repeats */
pfTGenPlane(Tgen,PF_T,0.0f,1.0f,0.0f,0.0f); /* repeate in y */
pfTGenMode(Tgen,PF_S,PFTG_OBJECT_LINEAR); /* set repeate in x */
pfTGenMode(Tgen,PF_T,PFTG_OBJECT_LINEAR); /* set repeate in y */
/* put it to your node */
Set = pfNewGSet(NULL);
pfGSetGState(Set,State);
if any one sees any errors in my discription or coding pleas fell free
to let us know..
from garrett
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:56:09 PDT