OpenGL text problem
Hey guys,
I got OpenGL text to work. The problem is that it functions the same way as a 3d model. If i turn the camera away - i can't see it. So, here's my question. How can i keep the text fixed on one position ( bottom left corner ) of the screen, regardless of what the camera does?
A related question is how can i do the same thing with a .bmp that is the "Interface" of the game - what i mean is, like the ones you see in rpg's, a bar on the side, or top or whatever that shows your health, items, etc, etc.
Thanks :D
Mike
what i do because i suck is keep a relative coordinate which is always at the middle of the screen thats being rendered, but i believe there are ways to do overlays and stuff independant of the actual coordinates that are being looked at.
still, relative origin coordinates seem to work pretty well for me, might be a good started o_O. just make them move the same rate as your camera does and it should be ok
still, relative origin coordinates seem to work pretty well for me, might be a good started o_O. just make them move the same rate as your camera does and it should be ok
Hey,
Check this out, it may help you.
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=13
Check this out, it may help you.
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=13
Make overlays the last step in rendering the scene.
Turn depth testing off.
Set the camera to an orthographic projection.
Load the identity matrix.
Begin rendering the text.
Turn depth testing off.
Set the camera to an orthographic projection.
Load the identity matrix.
Begin rendering the text.
// revert the camera to orthographic modeg_pCamera->SwitchProjections(); if (g_bHideText) { // push the matrix glPushMatrix(); // load the identity matrix glLoadIdentity(); // draw the text g_pFPSText->Draw(rElapsedTime); g_pStatText->Draw(rElapsedTime); g_pHelpText->Draw(rElapsedTime); // pop the matrix glPopMatrix(); } // revert the camera to a perspective mode g_pCamera->SwitchProjections();
How do i do these two things :
"Make overlays the last step in rendering the scene"
"orthographic projection"
"Make overlays the last step in rendering the scene"
"orthographic projection"
render your text as the last thing - overlays (correct me if i'm wrong)
and do a search here on game dev or google for glOrtho or gluOrtho
and do a search here on game dev or google for glOrtho or gluOrtho
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement