RE: Problems Overlaying Graphics

New Message Reply Date view Thread view Subject view Author view

rany++at++netvision.net.il
Fri, 27 Sep 96 23:20:38 PDT


Julia,

My guess is that by leaving the current matrix be GL_PROJECTION, while Performer
assumes otherwise, your DCS matrices are multiplied on the wrong matrix (they should
be multiplied on the MODELVIEW matrix).
You can get the current matrix by glGetIntegerv() and select it at the end of your HUD
draw.
FYI - you might simplify your code by drawing the HUD _after_ the pfDraw(). In this
case you need not use the stencil, but you will need to disable depth test for the HUD
draw, so that it overlays the 3D graphics.

Ran

--- On Fri, 27 Sep 1996 15:23:04 +0000 Julia Ellery <modellers++at++intersim.co.uk> wrote:

>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
>

-----------------End of Original Message-----------------

 __ | Ran Yakir
 /_) _ __ \ / _ / o __ | 28 Ben Gurion St.
/ )_ (_(_) ) \/ (_(_/<_(_)( | Hod Hasharon 54200
              _/ | Israel
-------------------------------------+--------------------------------
At Home : | At Work :
| RT-SET
  Voice : +972-9-989974 | Voice : +972-9-552236
  Fax : +972-9-422149 | Fax : +972-9-552239
  E-mail : rany++at++netvision.net.il | E-mail : rany++at++rtset.co.il

=======================================================================
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:39 PDT

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