glScale and normals

Hi all,

I have a question concerning the normals of an object.

In a modeller app, I generate the wireframe of an object, including normals at creation time of an object.
I then allow the user to manipulate the transformations of the object. When a non-uniform scaling is used the normals are incorrect. Since I have stored the normals in a data structure when the object was created, I’d prefer not to have to regenerate them. Can I do a transformation on the calculated normals before passing them to OpenGL to correct for this?

  • Lutz

whenever you do non-uniform scaling just enable GL_NORMALIZE - this sorts it all out for you.

Ahhh, thanks. At first I thought this is a global flag, but I see that I can enable it on a per-object basis, so I can check for scaling and then enable it if present.

Thanks for the hint.

  • Lutz

When you do non-uniform scaling, your normals will be incorrect (point in the wrong direction) even if you normalize them. This will mess up lightning. There is no function to make the normals correct, other than to recalculate them.

Just a note.

Hmmm. It looked pretty good

I was wondering whether I could maybe use an inverse scale transformations for the pre-calculated normals before sending them to glNormal3(). Then OpenGL will transform them to the correct orientation when it uses them.

While the lighting is not crucial (it’s a preview only), I would like to get it right.
But recalculating the pre-calculated normals is not something I want to do at this point.

  • Lutz