Re: OpenGL postdraw using Performer coordinates?

New Message Reply Date view Thread view Subject view Author view

Jan Barglowski (jan++at++archimedes.vislab.navy.mil)
Tue, 6 Jan 1998 17:03:47 -0800 (PST)


Nicolas Gauvin wrote:
>
> > I'd like to draw an OpenGL line between two locations in my Performer
> > scene. How do I convert the Performer coordinate system to OpenGL?
> >
>
> In a pfChannel draw callback you just need to draw your line with
> its 3D world coordinates. The GL modelview and projection matrices are
> already setup correctly at that point:
>
> void
> drawCB(pfChannel *chan)
> {
> chan->clear();
> pfDraw();
>
> pfPushState();
> pfBasicState();
> glColor...
> glBegin(GL_LINES)
> glVertex...
> glVertex...
> glEnd();
> pfPopState();
> }
>
> Its only in the 2D case that you have to reset the matrices. But then its
> simpler to use a second overlapping ortho pfChannel that doesn't clear.

Thanks to all that replied!

In short, I didn't have to do a thing but use the OpenGL draw commands.
I did try this, but somehow the line didn't draw until I explicitly set
the color (and opacity), then it appeared. I would guess the pfBasicState()
might do the same.

Thanks again!

jan

-- 
Jan Anthony Barglowski	              jan++at++chinalake.navy.mil
Real-time Computer Graphics           http://www1.ridgecrest.ca.us/~jan
Naval Air Warfare Center, China Lake  (760) 927-1057
=======================================================================
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:56:32 PDT

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