Advertisement

easy font question =)

Started by February 07, 2005 12:56 AM
0 comments, last by wendigo23 19 years, 9 months ago
OK, when I draw fonts and my camera is stationary (like in the tutorials) it works fine. When I move the camera though, the font moves around on the screen. How do I keep the font stationary when the camera moves. Using stuff straight out of the font tutorial so my draw function something looks like this: void DrawScene(void) { glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); gluLookAt(CAMERA.x, CAMERA.y, CAMERA.z, LOOK_AT.x, LOOK_AT.y, LOOK_AT.z, WORLD_UP.x, WORLD_UP.y, WORLD_UP.z); glRasterPos2f( x, y); glPrint( "some stuff", ); // then do all other rotation, drawing, etc... glFlush(); }
The coordinates you pass to glRasterPos are transformed by the model view matrix. So, when you start moving the camera around, the font will move, too. Set the model view matrix to identity before doing your fonts, for a start.

This topic is closed to new replies.

Advertisement