Problems Overlaying Graphics

New Message Reply Date view Thread view Subject view Author view

Julia Ellery (modellers++at++intersim.co.uk)
Fri, 27 Sep 1996 15:23:04 +0000


Can anyone help?

Performer 2.0
Indigo2 Impact
IRIX 6.2

I am trying to overlay Graphics for a Head Up Display. It appears
to work ok but all the mobile object positions (DCS nodes) are
corrupted.

I am using the following code in channel draw callback:

draw_chan(...)
{
   pfClearChan(chan);

   pfPushState();
   pfBasicState();

   glClear(GL_STENCIL_BUFFER_BIT);
   glStencilFunc(GL_ALWAYS, 0x1, 0x1 );
   glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);

   glMatrixMode(GL_PROJECTION);
   glPushMatrix();
   glLoadIdentity();
   gluOrtho2D(0, 1, 0, 1); /* Or use actual window size */

   glMatrixMode(GL_MODELVIEW);
   glPushMatrix();
   glLoadIdentity();

      Do HUD drawing.....

   glPopMatrix();
   glMatrixMode(GL_PROJECTION);
   glPopMatrix();

   /* Now want to draw database where stencil NOT 1 */
   glStencilFunc(GL_NOTEQUAL, 0x1, 0x1 );
   glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);

   pfPopState();

   pfDraw();
}

DCS problem goes away if I remove the ortho call (but then of
course the HUD is wrong). Can anyone tell me what I am doing wrong?

Thanks
J.Ellery

=======================================================================
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:53:38 PDT

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