Sign in to follow this  

Normal Transformation

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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).

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this