Jump to content
  • Advertisement
Sign in to follow this  
michaelj

How to caculate the Inverse-Transpose of a ModelView matrix ?

This topic is 3326 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

I've encountered a problem in writting the shader of OpenGL 2.0. The following is the header of the shader: attribute highp vec3 inVertex; attribute highp vec3 inNormal; attribute highp vec2 inTexCoord; uniform highp mat4 MVPMatrix; uniform highp mat4 ModelView; uniform highp mat3 ModelViewIT; So, I need to input vertex/normal/uv of the mesh, and the MVP matrix of the mesh in the scene. And, the "ModelView" uniform is easy to get, it is just: MdelView matrix = Translation matrix * Rotation matrix. But, I don't know how to get the "ModelViewIT" uniform. ModelViewIT means: "Inverse-Transpose of the ModelView matrix". So could anyone tell me how to calculate it out ? Thanks a lot!

Share this post


Link to post
Share on other sites
Advertisement
MdelView matrix = Translation * Rotation

Then

MdelView matrixIT = Inverse(Rotation) * Inverse(Translation)

Such that

Identiy = matrix * matrixIT;

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!