• Advertisement

Archived

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

Coordinates

This topic is 5192 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

I was searching around google on this and found a few things but i never found out what i wanted to know. What does like 1 pixel equal to in the opengl coordinate system. I am trying to do a 2d game and i want like a quad to be like 64x64 pixels and i dont know what that is in opengl. any suggestions ?

Share this post


Link to post
Share on other sites
Advertisement
That depends entirely on how you set up the projection and transformation matrices. For example, with an orthographic projection matrix you can easily archieve 1 OpenGL unit = 1 pixel.

Share this post


Link to post
Share on other sites
glOrtho(0, screenWidth, screenHeight, 0, -1, +1)

You might have to experiment a bit with the sequence of parameters to get the origin (here the origin is in the top left)of the coordinate system you want, but that's it basically.

Edit: Switched near and far clipping plane.

[edited by - BitMaster on February 6, 2004 12:37:28 PM]

Share this post


Link to post
Share on other sites

  • Advertisement