Re: Clipping with arbitary planes

New Message Reply Date view Thread view Subject view Author view

Angus Dorbie (dorbie++at++bitch.reading.sgi.com)
Sat, 22 Mar 1997 19:16:35 +0000


I think this *may* be due to the orientation of the clip plane through
the model transformation matrix.

Try glClipPlane before the pfDraw call in the channel draw callback,
then use glEnable in the object draw callbacks.

Cheers,Angus.

On Mar 22, 1:58am, Jukka Vaisanen wrote:
> Subject: Re: Clipping with arbitary planes
> On Fri, 21 Mar 1997, Angus Dorbie wrote:
>
> > 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);
> ...
>-- End of excerpt from Jukka Vaisanen

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:56 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.