From: Joost Verschuren (joost.verschuren++at++westbrabant.net)
Date: 02/04/2004 06:31:06
Hi,
I'm trying to manipulate the way all objects in a pfScene are displayed.
What I want to achieve is:
-enable/disable lighting of the entire scene
-enable/disable texturing of the entire scene
-enable/disable antialiasing of the entire scene
-set display mode of all objects in the scene to solid, wireframe, points
(draw vertices) or bounding box (with pfHighlight?)
I tried to attach a pfGeoState to a pfScene, but without result:
pfGeoState* gstate = new pfGeoState;
scene->setGState(gstate);
gstate->setMode(PFSTATE_ENTEXTURE, PF_OFF);
gstate->setMode(PFSTATE_ENWIREFRAME, PF_ON);
gstate->setMode(PFSTATE_ANTIALIAS, PFAA_ON);
When using callbacks I'm getting some results:
channel->setTravFunc(PFTRAV_DRAW, drawFunc);
...
void drawFunc(pfChannel *chan, void *data)
{
pfOverride(PFSTATE_ENLIGHTING, 0);
pfDisable(PFEN_LIGHTING);
pfOverride(PFSTATE_ENLIGHTING, 1);
chan->clear();
pfDraw();
}
Is using callbacks the only way to go or am I forgetting something for the
pfGeoState? I would like to use pfGeoStates because I may have to
manipulate individual objects in the scene.
Is there somebody who can give me some advice?
I'm using Performer 3.01 on Linux (RH8.0) and OpenFlight (.flt) 3D models.
Thanks in advance,
Joost Verschuren
This archive was generated by hypermail 2b29 : Wed Feb 04 2004 - 06:49:46 PST