Pan007
10-18-2011, 06:59 AM
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?
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?