🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Keeping The Text On The Screen?

Started by
2 comments, last by cbastien 15 years, 9 months ago
Ok, I got loading text tutorial done with NeHe and I was wondering is how can I attach the text to the camera when I move it around? Right now it just sits in the world and though I will find that useful, but I want to create a simple HUD that stays with the camera when I move it around. How can I accomplish this? C++/VS2005/Win32
Check out my open source code projects/libraries! My Homepage You may learn something.
Advertisement
Hi,

I'm not a specialist but an easy way would be to change the projection


Something like :

GLPushMatrix();
gluOrtho2D(-50,50,-50,50);
printText("toto")
GlPopMatrix();
Why not draw everything then draw your hud? that way the hud will always be where you are facing.
Quote: Original post by Shadowwoelf
Why not draw everything then draw your hud? that way the hud will always be where you are facing.


Right, Don't switch from 3d projection to 2d projection and vice versa 10 times per frame... Draw all your HUD in one time.

This topic is closed to new replies.

Advertisement