• ### What is your GameDev Story?

#### Archived

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

# Ortho Coords?

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

## 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 on other sites
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 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 on other sites
in other words, when the y coord increases, the point goes down,... when it decreases, it goes up.

##### Share on other sites
Maybe this is enough
ycoord *= -1;

##### Share on other sites
but then i would have to do that for every coord!!!

##### 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 on other sites
I think it depends on the way you call glOrtho

Take a look at this page, I think by changing some parameters, you can have the y axis inverted

http://www.mevis.de/~uwe/opengl/glOrtho.html

[edited by - Hedos on March 6, 2004 6:19:42 PM]

##### 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 on other sites
sweet! just what i wanted!

thanks!

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 13
• 9
• 9
• 15
• 14
• ### Forum Statistics

• Total Topics
634070
• Total Posts
3015335
×