Jump to content
  • Advertisement
Sign in to follow this  
tallica

creating HUD in 3d world using gluOrtho2D

This topic is 3826 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Quote:
Original post by D3DXVECTOR3
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 );


Hey! nice one mate, you got it spot on there. thanks for your help :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!