I'm yet again having opengl problems...but this one is really simple
Say I'm zooming in and out a polygon and in front of it is static text. like it's x and y positions. As you zoom the polygon in, it is able to get so close that is makes the text in front dissappear. Is there a way to make the front text truly static? like on the very top layer? thanks
What about drawing your text after all of your geometry has been drawn? That usually works fine for me.
I do, I'm using Nehe's 3d bitmap text. I use glprint at the way end of my DrawGLScene(). And the polygons zoom so close that for SOME reason, it still goes straight through the text!
here a copy and paste of the end of my drawglscene
that polygon alone totally overlaps the text.
glNormal3f( 0.0f, 0.0f, 1.0f);
glBegin(GL_QUADS); // Draw A Quad
glVertex3f(-1.0f, 1.0f, 0.0f); // Top Left
glVertex3f( 1.0f, 1.0f, 0.0f); // Top Right
glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right
EDIT: and to avoid confusion, that polygon that covers the text can also be overlapped by another polygon zoomed in and drawn before. That's really weird, how come polygons you draw before others can still overlap as if they're the top layer?
Try just turning off depth comparisons. What you are experiencing is z-fighting. So you need to tell opengl to always draw the text and disregard that a part of a polygon is in fact closer.
glDisable( GL_DEPTH_TEST );
Just remember to re-enable it when you're done.
YES! mr wizard, i'm telling you right now, this is the third time you've helped me really fast. you really are a wizard.
and my new best friend(again!)
Also the first text tutorial at NeHe (not the 3d font one) makes the text static I think.