View Full Version : Object distorting

02-03-2004, 01:23 AM
Hello there,

I am having a weird problem when I rotate an ellipsoid using glRotatef(...).

I draw the ellipsoid using a parametric equation (which is not work as it draws the ellipsoid perfectly). But when I rotate the ellipsoid it gets longer along the major axis and shorter along the minor axis.

The code for drawing and rotating works perfectly in another OpenGL program but not in the current one.

I am using MFC VC++ with an OpenGL window embedded in a dialog. I think it may have something to do with the set-up of the window. The program in which the rotation works is drawing it in a normal full size window.

Any help or suggestions would be appreciated.

02-03-2004, 08:49 AM
What is your aspect ratio for the projection?

You need to set your field of view (or whatever else you have on the projection matrix) to match the aspect ratio of the window or viewport.

02-04-2004, 10:44 AM
Got it! I was calculating the height and width of the wrong window (Dooh!).

Thanks very much.