Jump to content
  • Advertisement
Sign in to follow this  
tallica

using ortho2D in 3dWorld for HUD

This topic is 3969 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
In descending order of likelyhood...

Did you disable depth-buffer testing before drawing the UI? Otherwise it ends up fighting for depth in your 3D scene, just like any other rendered object.

If you do need depth-testing for your UI, are you clearing the depth buffer before drawing the UI?

If you do need depth-testing for the UI and elements within it are flickering over eachother, but not flickering with the 3D scene behind it, are you setting appropriate near- and far- plane distances after switching to orthographic mode (and changing them back to appropriate distances when switcing back to 3D)?

Are you setting up rendering states consistently beforehand (disable textures or set the correct one; set the right blending mode, enable/disable the right flags)?

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!