GUI Text

I’m trying to draw an object rotate it and then print the rotation angle on the screen.

I can do this but when the scene is rotated the text moves.

How can I fix the text to stay in the top left hand corner of the window always facing the user.

Thanks

If it is there when you didn’t move anything, you’re allright. Simply put the drawing stuff before any position or viewport dependant translations.

You could also, for example do this:
glMatrixMode( GL_MODELVIEW );
glPushMatrix();
// load your starting matrix (might be simply the identity matrix)
// draw your text
glPopMatrix();

Hi miguel
Can you give me sample code to print the text.
thanks

Hi Michael,

Thanks a lot I’ve managed to get it working now,
I had to translate on z to bring it to the front of the screen and then transalte back (so it wasn’t affected by zoom)

The code is available for text on NeHe’s tutorial site
Link from opengl.org - coding section
I think it’s lesson 12 or 13 - Bitmap fonts.

Thanks again Michael