Normal Transformation

Started by
3 comments, last by MannyK 16 years, 6 months ago
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
Advertisement
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.
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.
Ghostly yours,Red.
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
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).

This topic is closed to new replies.

Advertisement