Sign in to follow this  

using ortho2D in 3dWorld for HUD

This topic is 3661 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
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

This topic is 3661 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this