# Transform After Normalizing

This topic is 3665 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Greetings, This has been driving me crazy. I've got a triangle set up and have calculated the Normal Vector for it. I translations, rotations, and scales going on, but one of them is messing up the original normal vector. My guess is that it is the rotations, mainly because the face of the object will be pointed in a completely new direction. I almost feel dumb asking this. Thanks.

##### Share on other sites
You're correct. Rotating a triangle can point it in a new direction, changing its normal. Remember what a normal is: a vector that points in the direction that the surface faces, and has length 1.

Scaling and translating a triangle cannot affect its normal. Think about stretching or moving a triangle laid flat on the ground. No matter where you move it or stretch it, it's still flat on the ground, and so still facing in the same direction and still has the same normal.

EDIT: jdindia is right, applying a scaling transform in general can affect the normal too. I was thinking only of uniform scales. If your scale is uniform, then scaling by a positive won't affect the normal, and scaling by a negative will flip the normal (make it negative).

[Edited by - Melekor on November 30, 2008 3:20:02 AM]

##### Share on other sites
Scaling will definitely do it if it's not uniform and not corrected.

Also, you have to apply the appropriate transform to the normal vector. You don't treat it like a vertex. OpenGL and DirectX take care of this for you, unless you're writing a shader.

http://www.lighthouse3d.com/opengl/glsl/index.php?normalmatrix
gives an explanation of this.

##### Share on other sites
Good to see i am not going crazy! Thanks for the help. :-)

1. 1
2. 2
3. 3
4. 4
Rutin
13
5. 5

• 26
• 10
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633696
• Total Posts
3013394
×