View Full Version : Skewing of glut primitives problem!

05-18-2005, 01:18 AM
Im currently making a human model that can be animated. for some reason when i rotate the model about the torso in any axis (x, y or z) the model becomes skewed. I use glut primitives (glutSolidSphere and glutSolidCube) for the model. When i say skewed i mean that the objects are displayed out of proportion, for example the head instead of being a sphere of radius 1.5, it becomes and oblong. Just wondering if anyone has any idea what could be causing this because ive been working on it for hours!!

Thanks for you help, link664

05-18-2005, 02:37 AM
Does the aspect ratio of window's client area match the aspect ratio of your projection?
Here's a piece of code correcting the aspect ratio:
For gluPerspective it's even simpler.

05-18-2005, 03:01 AM
i use a perspective view, not orthogonal, but my aspect is right anyway im pretty sure.

the entire code is located here:


and i have posted sum pictures as well showing the distortion:


if that will helps you.

Thanks, link664

05-18-2005, 03:58 AM
i use a perspective view, not orthogonal, but my aspect is right anyway im pretty sure.
Your reshape function looks broken (same instruction in both if-branches) and will crash for zero height windows.

Zooming is not done with a scale, but with a different field of view in the gluPerspective call.

You have a glScale at a place where it affects the following transformations. Make sure you never have a non-uniform scale with that.
Check zoom == 1.0.
You need to read from the glVertex call upwards to get the OpenGL (left-multiplied) transformation hierarchy. The scale also affects the translations.