Sign in to follow this  
JohnnyCode

tangent matrix inverse

Recommended Posts

hello! I want to move a normal from texture space to object space. I have a tangent matrix that moves from object space to texture space. If I inverse this matrix, will I then have a matrix that will move a direction vector from texture space to object space?

Share this post


Link to post
Share on other sites
Quote:
Original post by JohnnyCode
hello!
I want to move a normal from texture space to object space. I have a tangent matrix that moves from object space to texture space. If I inverse this matrix, will I then have a matrix that will move a direction vector from texture space to object space?


The general answer is yes; but I generally prefer to perform calculus in Tangent Space (but this is personally).

Regards
Mauro
http://www.breakinglass.com

Share this post


Link to post
Share on other sites
Yes you are correct, but:

Usually you keep your tangent space matrix orthonormal (though you don't have to)
which allows you to use the transpose of that matrix as its inverse because keeping both at every vertex would be expensive.

In practice, in hlsl, just multiply from the left to go one way, and from the right to go the other way, because mul(v,M) is the same as mul(transpose(M),v)

Share this post


Link to post
Share on other sites
Quote:
Original post by kgy
Yes you are correct, but:

Usually you keep your tangent space matrix orthonormal (though you don't have to)
which allows you to use the transpose of that matrix as its inverse because keeping both at every vertex would be expensive.

In practice, in hlsl, just multiply from the left to go one way, and from the right to go the other way, because mul(v,M) is the same as mul(transpose(M),v)


Thanks!

Share this post


Link to post
Share on other sites

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