PDA

View Full Version : glOrtho



sadhu
02-11-2002, 03:14 AM
Hi ,

I am using the orthographic projection (glOrtho) .

If the width and height of the viewport are not equal , then my object getting distortion. So , how to make it correct.
How find the aspect ratio , if the projection is Orthographic.

Thak you.
sadhu

02-11-2002, 03:57 AM
Hope this would be helpful.

aspect ratio=w/h;
if(w<= h)
glOrtho(-1.0, 1.0,-1.0/aspect, 1.0/aspect, -1.0,1.0);
else
glOrtho(-1.0*aspect,1.0*aspect,-1.0, 1.0, -1.0, 1.0);


Originally posted by sadhu:
Hi ,

I am using the orthographic projection (glOrtho) .

If the width and height of the viewport are not equal , then my object getting distortion. So , how to make it correct.
How find the aspect ratio , if the projection is Orthographic.

Thak you.
sadhu