Heads Up Display

dave05
Unregistered
 
Post: #1
This is my first "3d" game, so I apologize for all the questions in an absurdly quick succession.

Anyways, I have the 3d engine somewhat set up, but now I want to draw a bunch of stuff on top to indicate various player status information.

What I'm thinking is:

...
//draw the 3d environment
...
//draw on top of all that
glDisable(GL_DEPTH_TEST);
glOrtho2d(0,800,0,600);
..

then start drawing. The reason I'm asking is I'm going to implement it tomorrow and would rather avoid any unnecessary bugs. Does this seem like a good method? Do I need to "LoadIdentity" on the "Modelview" matrix before I call glOrtho2d?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Code:
draw3DStuff();

glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0.0, 800.0, 0.0, 600.0);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();

draw2DStuff();

glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Heads up: glDrawbuffer(GL_FRONT) issue w/OS X 10.4.3 and NVidia cards zKing 4 3,740 Jan 11, 2006 01:00 PM
Last Post: arekkusu