From: Chee Tzuon (CheeTzuon++at++stts.com.sg)
Date: 04/09/2003 18:26:26
Hi
Thanks for the help. got the files from linux version of Performer 3.0
For SGI's info, u did not include the volfog or fogfly folder in Performer 3.0 for NT
Thank You all for the help
Regards
Jason
-----Original Message-----
From: Radomir Mech [mailto:rmech++at++engr.sgi.com]
Sent: Thursday, April 10, 2003 12:32 AM
To: Chee Tzuon
Cc: info-performer++at++sgi.com
Subject: Re: [info-performer] How to use pfVolFog
Hi Jason,
have you checked the sample code in
/usr/share/Performer/src/sample/C++/volfog or
/usr/share/Performer/src/sample/C/fogfly ?
Cheers,
Radomir
Chee Tzuon wrote:
>
> Hi pfAll,
>
> Have read all the man pages and the manual about patchy Fog. Managed to create layered fog with pfVolFog, but do not understand how to create patchy Fog.
> Tried inserting the node part with a geoset of cube but still unable to see the results. Can anyone help?? The following is the part which i used to create the patchy fog
>
> pfDCS *fognode=new pfDCS;
> pfVec3 *scoords;
> pfCoord fogpos;
>
> fogpos.xyz.set(1100,3300,20);
> fogpos.hpr.set(0,0,0);
>
> void *arena=pfGetSharedArena();
> pfGeode *fogeode = new pfGeode;
> pfGeoSet *fogset=new pfGeoSet;
> pfGeoState *fogstate = new pfGeoState;
>
> fogstate->setMode(PFSTATE_CULLFACE,PFCF_OFF);
> fogstate->setMode(PFSTATE_ENLIGHTING, PF_ON);
> fogset->setPrimType(PFGS_QUADS);
> fogset->setNumPrims(6);
>
> scoords=(pfVec3*)pfMalloc(24*sizeof(pfVec3),arena);
> scoords[0].set(0.0,0.0,0.0);
> scoords[1].set(5.0,0.0,0.0);
> scoords[2].set(5.0,0.0,5.0);
> scoords[3].set(0.0,0.0,5.0);
>
> scoords[4].set(5.0,0.0,0.0);
> scoords[5].set(5.0,5.0,0.0);
> scoords[6].set(5.0,5.0,5.0);
> scoords[7].set(5.0,0.0,5.0);
>
> scoords[8].set(5.0,5.0,0.0);
> scoords[9].set(0.0,5.0,0.0);
> scoords[10].set(0.0,5.0,5.0);
> scoords[11].set(5.0,5.0,5.0);
>
> scoords[12].set(0.0,5.0,0.0);
> scoords[13].set(0.0,0.0,0.0);
> scoords[14].set(0.0,0.0,5.0);
> scoords[15].set(0.0,5.0,5.0);
>
> scoords[16].set(0.0,0.0,5.0);
> scoords[17].set(5.0,0.0,5.0);
> scoords[18].set(5.0,5.0,5.0);
> scoords[19].set(0.0,5.0,5.0);
>
> scoords[20].set(0.0,0.0,0.0);
> scoords[21].set(5.0,0.0,0.0);
> scoords[22].set(5.0,5.0,0.0);
> scoords[23].set(0.0,5.0,0.0);
> fogset->setAttr(PFGS_COORD3,PFGS_PER_VERTEX,scoords,NULL);
>
> fogset->setGState(fogstate);
> fogeode->addGSet(fogset);
> fognode->addChild(fogeode);
> fognode->setCoord(&fogpos);
>
> vFog->setVal(PFVFOG_PATCHY_MODE, PFVFOG_LINEAR);
> vFog->setColor(1,0,0);
> vFog->setDensity(1.0);
> vFog->addNode(fognode);
> scene->addChild(fognode);
> vFog->apply(scene);
> vFog->addChannel(chan);
>
> chan->setTravFunc(PFTRAV_DRAW,drawCall);
>
> -----------------------------------------------------------------------
> List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
> -----------------------------------------------------------------------
This archive was generated by hypermail 2b29 : Wed Apr 09 2003 - 18:31:29 PDT