PDA

View Full Version : scaling and normal calculating



Nil_z
07-07-2002, 08:17 PM
If I want to morph an object by scaling, how can I calculate the normal correctly according to the *different* x,y,z scaling factor?

ioquan
07-07-2002, 10:01 PM
Where are you getting the normals in the first place? You're going to have to recalculate them just as if you'd never had them.

[This message has been edited by ioquan (edited 07-08-2002).]

V-man
07-08-2002, 07:25 AM
It's better to enable normalization. You are talking about applying glScale to the modelview right?

V-man

harsman
07-08-2002, 08:06 AM
If the scaling is non-uniform, i.e. the scale factors for x,y and z differ, I don't think you can do anything but normalize. With uniform scaling however there is a cheaper way to ensure unit length normals. See the rescale normal part of GL 1.3 or the rescale normals extension, I think they cover the math.

Miguel_dup1
07-09-2002, 12:52 PM
Read this article... http://www.opengl.org/developers/code/features/KilgardTechniques/oglpitfall/oglpitfall.html

knackered
07-09-2002, 01:18 PM
GL_NORMALIZE is really fast on GF3's.