Steve Baker (steve++at++mred.bgm.link.com)
Wed, 21 Aug 96 11:47:32 -0500
> > if ( you_need_wireframe )
> > {
> > pfEnable ( PFEN_WIREFRAME ) ;
> > pfOverride ( PFSTATE_ENWIREFRAME, PF_ON ) ;
> > }
> > else
> > pfOverride ( PFSTATE_ENWIREFRAME, PF_OFF ) ;
> >
> >...somewhere just before pfDraw() ???
> >
> >
couvet++at++pobox.oleane.com replied...
> Thanks for your answer, Mr. POUTIGNAT wasn't wrong but your approach is
> a little bit faster (but still slightly wrong...)=20
>
> I got the answer today. What to do is the following :
>
> if ( you_need_wireframe )
> {
> pfEnable( PFEN_WIREFRAME);
> }
> else
> {
> pfDisable( PFEN_WIREFRAME);
> }
>
> I got some friends who told me that it works fine...
Well, I thought *VERY* carefully about the pfOverride(PFSTATE_ENWIREFRAME,PF_ON)
and I can assure you that it isn't 'slightly wrong'.
I use this in my application - so I KNOW it works - if you don't do the
pfOverride, then if any of the pfGeoStates in your database explicitly have
pfGStateMode ( gs, PFSTATE_ENWIREFRAME, PF_OFF ) ;
...then they won't be displayed in wireframe with your version of the code.
Hence you need to pfOverride the state change flag so that Performer will
refuse to change the state of the wireframe flag until further notice.
So, in English, my code says:
if you really want wireframe then...
tell performer that we want wireframe and...
tell performer not to let anyone change that decision...
otherwise
let geosets choose how they want to be displayed, so
that things that *need* to be in wireframe (eg power lines
in a helicopter flight simulator) can still be in wireframe.
...this is usually what people want from a wireframe mode.
Of course, there are 23 good ways (and 50 bad ways) to do everything in Performer,
so you choose what's right for you.
Steve Baker 817-323-1361 (Vox-Lab)
Hughes Training Inc. 817-695-8776 (Vox-Office/vMail)
2200 Arlington Downs Road 817-695-4028 (Fax)
Arlington, Texas. TX 76005-6171 steve++at++mred.bgm.link.com (eMail)
=======================================================================
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:53:23 PDT