#### Archived

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.

## 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]

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5
JoeJ
19

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632998
• Total Posts
3009808
• ### Who's Online (See full list)

There are no registered users currently online

×