Jump to content
  • Advertisement

Archived

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

colinisinhere

Ortho Coords?

This topic is 5343 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''m using the NeHe ortho tut #21. But the y axis is inverted? the point 0,0 is on the top left! and 0,1024 is the bottom left! I need the make it normal, so that the point 0,0 would be the bottom left. how can this be done!?!?

Share this post


Link to post
Share on other sites
Advertisement
just use simple maths. I assume your talking about texture coordinates since the y axis is reversed in opengl. (MaxScreenY - whatever pixels from the top) will convert it.

Share this post


Link to post
Share on other sites
no,i dont know about the texture coords, but the actual coords!

the y coords are inversed!

[edited by - colinisinhere on March 6, 2004 2:52:54 PM]

Share this post


Link to post
Share on other sites
That''s just the way monitors work. The scangun starts at the top left, so that became (0,0) by convention. You just have to learn to work with things upside-down.

Share this post


Link to post
Share on other sites
It''s indeed like this.

To get the topleft 0, 0 bottom right max, max you call glortho like this for example :

glOrtho(0,XSCREENSIZE,YSCREENSIZE,0,-10,10);

glOrtho(0,XSCREENSIZE,0,YSCREENSIZE,-10,10);

Reversing the bottom/top for the Y axis would make the 0 start at the bottom and the max being at the top like the 2nd example.

Or something like this.

Thorb

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!