lesson13 and Screen Positioning
I''ve been building a small physics sim using nehe''s tutes as my base
code, yesterday I added the glPrint code from lesson13, at the moment just to display a FPS counter.
Anyway, the problem is, how do you get the text to occupy a fixed
position on the screen?
I''m using gluLookAt for my camera movements, and while I''ve managed to get the position fixed for linear camera movement (Target and Eye, moving at the same rate) when you move the camera eye, leaving
the target in place, the text sort of slides around the screen.
*Any* suggestions would be hugely appreciated as this one has me beat. I was thinking later on of using textured quads, for GUI objects, so being able to specify an absolute screen position, is fairly important....
"...we can't stop here! This is bat country!" - Hunter S Thompson
Bitmap fonts
"...we can't stop here! This is bat country!" - Hunter S Thompson
You can position the text in Orthographic view mode. Use either of the commands:
glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far);
or
gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
And then display the text on the screen.
And change back to perspective mode
For more on orthographic projection, look at Tutorial 21 on NeHe's site
Hope this helps, James
[edited by - James Trotter on January 24, 2003 6:59:11 AM]
glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far);
or
gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
And then display the text on the screen.
And change back to perspective mode
For more on orthographic projection, look at Tutorial 21 on NeHe's site
Hope this helps, James
[edited by - James Trotter on January 24, 2003 6:59:11 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement