Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Positioning text (tutorial #13)

This topic is 5443 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, Been going through some of the tutorials here (dig them, cheers Nehe and others). In tutorial #13, it is said: "You'll notice that if you translate even deeper into the screen the size of the font does not shrink like you'd expect it to. What actually happens when you translate deeper is that you have more control over where the text is on the screen. If you translate 1 unit into the screen, you can place the text anywhere from -0.5 to +0.5 on the X axis. If you translate 10 units into the screen, you place the text from -5 to +5." What actually happens for me is that I can place the text somewhere like -0.55 < x < 0.55 and -0.4 < y < 0.4. Now this would make sense since my OpenGL window is 800x600, but going through the math, it doesn't quite fit. I'd expect my x limits to be 800/600/2 = 0.666 and my y limits to be 600/800/2 = 0.375. In other words: I do not see where the 0.55 and 0.4 limits come from. Is this related to the fact that I am translating into the screen by 1? The weird thing is that if I have an 800x600 window I have one set of limits ... with a 400x300 (i.e. the same aspect ratio) my limits are now slightly different. Is there someone clever who knows how to calculate these limits given window width & height? My numbers always end up differently when I try with different window sizes and I'd like a generic solution. Thanks in advance Best regards Bjorn [edited by - sunbeam60 on November 28, 2003 7:52:55 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!