PDA

View Full Version : Distortions with Multi Viewports



Geometrian
07-17-2007, 01:53 AM
Hi,
I'm using PyOpenGL to make two viewports, but they are both distorted in the y direction. My code is basically a best "guess" at how to do it.

Can anyone show me code that would make two viewports side by side each 1/2 the width of the screen with no distortions in perspective (not ortho.)?
Geometrian

remdul
07-17-2007, 05:53 AM
Methinks you are not setting a proper aspect ratio.

asp = viewport_width / viewport_height;
gluPerspective(fov, asp, nearplane, farplane);

Geometrian
07-17-2007, 10:39 AM
Ah. Right. I was dividing by the width of the entire thing. Thanks.