Skip to main content
gamedev.net
🔒 Locked

Relationship between coordinates

Started by Toaster7 3 replies 200+ views
Original Post
Toaster7
Toaster7
How to make the relationship between openGL vertex coordinates (1.0f, -1.0f ...) and screen coordinates? For example, if I want to see a square of exactly 100*100 pixels on the screen, how do I compute the corresponding vertex coordinates? thanks, fred.
python_regious
python_regious
Search for projection matrices, once you have read up about it, you should be able to figure it out for yourself.
If at first you don't succeed, redefine success.
Toaster7
Toaster7
Thanks AP I''ve looked into the glOrtho() function and I''ve managed to do what I wanted. However I''m a bit surprised with the texture mapping in this mode. Indeed, I''ve mapped a 128*128 pixels texture on a 128*128 pixels square (I know it''s exactly this size thanks to the glOrtho() function) and my texture is *not* filtered, even though I''ve specified a linear filtering. In fact that''s great becasue that''s what I wanted, however I''m wondering why it''s not been filtered. Because it is rendered at its original size? Is it a feature or a bug?
VolkerG
VolkerG
What shall get filtered? In this context filtering is just used to do a texel <-> pixel conversion. When a pixel doesn''t line up with a texel you get an weighted average value of the affected texels. But if a pixel is lined up with a texel you get the pixel will have the texel''s color.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.