Re: OpenGL postdraw using Performer coordinates?

New Message Reply Date view Thread view Subject view Author view

Nicolas Gauvin (nicolas++at++cae.ca)
Tue, 6 Jan 1998 17:58:00 -0500


On Jan 6, 8:56am, Jan Barglowski wrote:
> Subject: OpenGL postdraw using Performer coordinates?
> Performers:
>
> 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.

-- 
Nicolas Gauvin              CAE Electronics Ltd., 8585 Cote De Liesse
3D Graphics Software        Saint-Laurent, Quebec, Canada, H4L-4X4
nicolas++at++cae.ca              Tel: (514) 341-2000 x2275, Fax: (514) 340-5496 
=======================================================================
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.