I am trying to build an app with a split screen, where both the top and bottom halves of the window show the same scene. The problem is that if I set the projection matrix w/ an aspect ratio of winX/(winY/2) (which I expect to be correct), the perspective in the top rendering (which is drawn first) is stretched vertically and the bottom rendering looks good.
If I change the aspect ratio to winX/winY, the top looks good and the bottom is stretched horizontally. I’m not sure why this is. Any help would be greatly appreciated.
My code is:
glViewport(0, winSizeY/2, winSizeX, winSizeY);
glMatrixMode (GL_PROJECTION); glLoadIdentity();
gluPerspective(45.0f, (GLfloat)winSizeX/(GLfloat)(winSizeY/2), 1.0f, 50.0f);
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
setViewPoint();
drawScene();
glViewport(0, 0, winSizeX, winSizeY/2);
drawScene();
glFlush();