creating HUD in 3d world using gluOrtho2D
Hello everyone, this is my first post so sorry for any wrong doing.
Basically I am making a 3d world in which I can move around. I need to make a head up display (HUD) fixed to the screen as I wonder around.
I have created this by changing the matrix model etc like so:
void function(void)
{
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0, 800, 0, 600);
createHud(); // SIMPLE 2D VECTORS IN HERE 100*800
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
}
The problem is, I can't see the HUD properly in my world. It flickers on the screen now and again like it is fighting to be displayed. Does anyone know how to have this problem solved?
many thanks in advance.
use glOrtho instead with small values for the near and far clipping planes
ie near = 0 and far = 1
glOrtho( 0, 800 , 600 , 0, near, far );
ie near = 0 and far = 1
glOrtho( 0, 800 , 600 , 0, near, far );
That shouldn't make a difference if the HUD is done using glVertex2 instead of glVertex3.
Make sure you don't have depth testing on when you draw your HUD, and that any polygons are facing the right way (or backface culling is disabled). That's sometimes a problem I have doing HUDs.
Make sure you don't have depth testing on when you draw your HUD, and that any polygons are facing the right way (or backface culling is disabled). That's sometimes a problem I have doing HUDs.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement