Jukka Vaisanen (vaizki++at++merlin.iscape.fi)
Sat, 22 Mar 1997 01:58:47 +0200 (EET)
> You can call glClipPlane and glEnable from within a performer draw
> callback.
>
> This will allow you to create an arbitrary clip plane which slices
> through the scene.
I got the attached code to work if I set the funcs to the scene, but not
if I set the funcs to the site_objs pfGroup. Can't I have these callbacks
in pfGroups? I don't want to clip the entire scene, just some objects if
possible.
int klipPre(pfTraverser *_trav, void *_userData)
{
GLdouble plane[4] = { 0.0, 1.0, 1.0, 0.0 };
glClipPlane(GL_CLIP_PLANE1,plane);
glEnable(GL_CLIP_PLANE1);
return 0;
}
int klipPost(pfTraverser *_trav, void *_userData)
{
glDisable(GL_CLIP_PLANE1);
return 0;
}
and in my scene setup:
...
SimState->scene->addChild(SimState->site_objs = new pfGroup);
SimState->site_objs->setName("SiteObjs");
SimState->site_objs->setTravFuncs(PFTRAV_DRAW, klipPre, klipPost);
...
=======================================================================
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:54:56 PDT