glOrtho() Mirror Image

Hello,

I am using glOrtho command to set the camera viewing positions for my opengl window in QT, I need to make center of the screen as orgin.But, when I load any texture on GL window it appears like mirror Image. I am doing as below.

glViewport(0.0f, 0.0f, 650, 800);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-325 , 325, -350, 250, -15, 15);
glMatrixMode(GL_MODELVIEW);

when I change the glOrtho statement to
glOrtho(-325 , 325, 250, -350, -15, 15); it works, I mean texture would be shown normally. But I know there is something wrong because this is against specification of glOrtho().

How to set the view origin to center without effecting on other primitives or textures?

It isn’t against the specification.

you call
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-325 , 325, -350, 250, -15, 15);

after you are done rendering your quad with that texture.

I bet that the problem is not in the projection but in the way you map the texture!

Change t-koordinates of the vertices and everything will be just fine. :wink:

Yes Thank you Aleksandar! you are right…
I am using glTexCoord2d() with wrong quadrants.
Thanks for the link V-man, Now I have to explore about the GLU stuff
Thanks Again!