Hi guys!
I’ve got a scene setup that is using a glOrtho projection, and it’s looking great so far. I’m inverting my bottom and top coordinates though because I want 0,0 to be at the top left…so after calculating my left, right, bottom, and top, I’m passing it like so:
glOrtho(left, right, top, bottom, 1.0, 100.0);
This gives me a projection where 0,0 is at the top left and, for example, 10,10 is at the bottom right. To do it any other way will require me to completely rewrite my scene logic and that would suck.
As I said though, all of this is working fine, except for one problem. I’ve added gluUnProject to the mix, and when I grab the mouse cursor position in world coordinates, I’m getting an inverted Y axis. It’s like it’s ignoring my glOrtho inversion. In the 0,0 top left - 10,10 bottom right example…if I click in the top left corner, gluUnProject gives me about 0,10.
Do I have to invert any of the parameters I’m sending to gluUnProject to match my inverted glOrtho?