# Rotate normals without "reuseing" vertices

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

## Recommended Posts

Hey, Is there a way to rotate/recalculate normals without vertex input? Greetings, Michael L.

##### Share on other sites
Could you be a bit more detailed in what you want to do?

Do you want to calculate the Normals of a model, without looking at the individual vertices?

##### Share on other sites
I already have the normals of that model.

Now i want to change/rotate the normals as like the model itself has been rotated without having to use all vertex matrix data again to accomplish this.

##### Share on other sites
What 3D API are you using? OpenGL, DirectX?

Well, under OpenGL (and I guess DX3D too, why would it be diferent), once you define the model, it's vertices, it's normals, texture coordinates, vertex colors, etc, if you rotate the model, the vertex normals rotate with it, so there is no need to run the normals through a rotation/transformation matrix.

But, if you are coding your own renderer, or using a software based one, then perhaps you do need to pass the normals through the matrix...

Another advice I can give you is that the quality of the responses you get here on the forums is proportional to the way you ask your questions, so please try to explain what you're trying to accomplish in as much detail as possible, if you want better responses...

##### Share on other sites
Transforming vectors is different from rotating vertices.
I assume here that you already have a 4x4 transformation matrix (containing the rotation you want). To use that matrix to rotate a (normal-)vector, you'll first have to calculate it's inverse. From the inverse matrix you calculate the transposed matrix. You can rotate vectors by multiplying them with that transposed matrix.

Tom

##### Share on other sites
Thx,

I think I really have to use the vertex matrix.

##### Share on other sites
Quote:
 Original post by dimeboltTransforming vectors is different from rotating vertices.I assume here that you already have a 4x4 transformation matrix (containing the rotation you want). To use that matrix to rotate a (normal-)vector, you'll first have to calculate it's inverse. From the inverse matrix you calculate the transposed matrix. You can rotate vectors by multiplying them with that transposed matrix.Tom

Agreed. And, if you know you have no scaling you can skip the 'inverse + transpose 3x3' part and directly apply the upper 3x3 rotation matrix of your 4x4 model matrix.

If you have scaling, you can simply scale the upper 3x3 rotation matrix by the inverse scale of your model but this can get (moderatly) nasty if you work in a hierarchy.

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

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

• Total Topics
633701
• Total Posts
3013445
×