View Full Version : GUI Text

11-28-2000, 08:02 AM
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.


Michael Steinberg
11-28-2000, 08:05 AM
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 );
// load your starting matrix (might be simply the identity matrix)
// draw your text

11-29-2000, 02:00 AM
Hi miguel
Can you give me sample code to print the text.

11-29-2000, 06:11 AM
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