# Normal Transformation

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

## Recommended Posts

hey folks, well I hope this is my last question for my current project... In my Bone-Mesh-AnimationProgram I have Bones which got vertices assigned. I did the Transformation of the mesh-vertices correct but the normals are freaky. I used: vert_new = pBone->Mtx_final*CurrentVertex*pBone->fWeight + ... I tried using the same Matrix (final) for the normals which didn't work. I read something about the inverse transposed which didn't work either, so here's my first question: Can the weighting system be applied to the normals (like above)??? Or: how do I have to transform the normals? thanx guys

##### Share on other sites
Are you using using non-uniform scaling? If you are, then you must use the inverse transpose of your matrix to get the correct normal.

##### Share on other sites
Hi,

Be aware that your matrix holds a lot of transformations:
- rotation
rrr0
rrr0
rrr0
0001
- scaling
s000
0s00
00s0
0001
- translation
1000
0100
0010
ttt1

For normals, you only need to rotate them. Getting rid of rtanslation is simple. Scaling is much harder (unless you already know wat are your scaling factors on each axis). This is why you use the inverse transpose matrix to remove the effect of scaling.

Regarding your weighted mesh: when the normals are computed per vertices, you need to apply the weight on your normal transformation and you must normalize your normals later: the sum of all weighted rotated normals on one vertex is not a normalized vector.

Hope that helps.
Ghostly yours,
Red.

##### Share on other sites
thanx everybody

yes I had to use the same final-matrix from the bone and erase the translation part (zero-out).
The renormalized normals didn't give a better result than without renormalizing... so I leave it with that.

thanx again folks

##### Share on other sites
1) be careful to differentiate transforming a position and transforming a vector. Only use the 4x4 for positions. Only use the 3x3 (no translate, no perspective) on vectors. However normals are SPECIAL vectors. You must use the inverse transpose if your matrix has non-uniform scale in it. In which case be careful how you compute your inverse. You must do the FULL matrix inverse and not use the shortcut of using the transpose as the inverse. The transpose is the inverse only for orthogonal matrices which you do not have (otherwise you will not have to do all these extra work).

1. 1
2. 2
3. 3
4. 4
Rutin
15
5. 5

• 14
• 9
• 10
• 12
• 17
• ### Forum Statistics

• Total Topics
632910
• Total Posts
3009173
• ### Who's Online (See full list)

There are no registered users currently online

×