Re: pfHighlight

New Message Reply Date view Thread view Subject view Author view

Angus Dorbie (dorbie++at++sgi.com)
Fri, 13 Mar 1998 17:38:17 -0800


Liu Xiaoyan wrote:
>
> Hi,
>
> I just ran into a problem of pfHighlight, it doesn't work at all.
> What I'm trying to do is to HighLight an object when the mouse is
> inside its bounding box. It's coded inside a C++ class. I'm using
> Performer 2.1 on Onyx2IR.
>
> void grabDCS::getInto(void) // highlight object in whatever mode
> {
> pfHighlight *hl;
> hl = new pfHighlight;
> pfEnable(PFEN_HIGHLIGHTING);
> // hl->setMode(PFHL_BBOX_LINES);
> hl->setMode(PFHL_LINES | PFHL_LINESPAT);
> hl->setColor(PFHL_FGCOLOR, 1.0f, 0.0f, 0.0f);
> // hl->setColor(PFHL_BGCOLOR, 1.0f, 0.0f, 0.0f);
> hl->apply();
> }
>
> void grabDCS::goOut(void) // remove highlight when mouse is outside
> { pfDisable(PFEN_HIGHLIGHTING);
> }
>
> Any idea?

Your geostate information probably doesn't have highlighting
enabled so you need to override highlight state on after you
enable in the pre draw then turn override off in the post draw
callback.

Also your methods look like application level code which is
legal if you are running single threaded but very wrong if
you run multiprocessed asumming you are using libpf not libpr
and aren't calling these in and out methods from draw callbacks.
You need to use draw callbacks if you aren't already.

Cheers,Angus.

-- 
"Only the mediocre are always at their best." -- Jean Giraudoux 

For advanced 3D graphics Performer + OpenGL based examples and tutors: http://www.dorbie.com/ ======================================================================= 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:57:01 PDT

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