Sign in to follow this  
therealremi

how to convert normal, tangent and binormal to another coordinate space?

Recommended Posts

therealremi    110
I have a matrix X( Point3(1,0,0),Point3(0,1,0),Point3(0,0,1),Point3(0,0,0) ) and I convert a point to this coordinate space by multiplying it by X. But can I do the same with normals, tangents and binormals? Is it ok to just do: normal = normal * X; tangent = tangent * X; binormal = binormal * X; ? Another question: The texture coordinate point U(s,t) in my eninge is equal to texture coordinate point U'(s, 1.0-t) in the application that computed the tangents and binormals. How to convert the tangents and binormals to take account of that difference?

Share this post


Link to post
Share on other sites
Sneftel    1788
In this particular case (the identity matrix) it'll work. However, for complicated mathematical reasons I'll go into if you like, you cannot simply multiply by the transformation matrix if it is not orthonormal. Instead, you need to strip off the transformation, and then multiply by the inverse of the transpose of the matrix.

Share this post


Link to post
Share on other sites
JohnBolton    1372
Quote:
Original post by therealremi
But can I do the same with normals, tangents and binormals?


Yeah, what Sneftel wrote... but I prefer "bitangent" over "binormal", since the vector is tangent and not a normal.

Share this post


Link to post
Share on other sites
Sneftel    1788
Wow, I can't believe I passed up an opportunity to say that. Yes, what JB said: "Binormal" isn't a word that means anything when you're dealing with surfaces.

Share this post


Link to post
Share on other sites
therealremi    110
Yeah, I know what you mean:

"The term binormal is commonly used as the name of the second tangent direction (that is perpendicular to the surface normal and s-aligned tangent direction). This is a misnomer. The term binormal pops up in the study of curves and completes what is known as a Frenet frame about a particular point on a curve. Curves have a single tangent direction and two orthogonal normal directions, hence the terms normal and binormal. When discussing a coordinate frame at a point on a surface, there is one normal direction and two tangent directions, which should be called the tangent and bitangent."

I just thought most people would be confused about the term bitangent;)

Thanks for answering. I'm still waiting for advice on what to do with this texture coordinates format difference in terms of TBN computation (or shouldn't I do anything with that?).

Share this post


Link to post
Share on other sites
Eric Lengyel    3461
Quote:
"The term binormal is commonly used as the name of the second tangent direction (that is perpendicular to the surface normal and s-aligned tangent direction). This is a misnomer. The term binormal pops up in the study of curves and completes what is known as a Frenet frame about a particular point on a curve. Curves have a single tangent direction and two orthogonal normal directions, hence the terms normal and binormal. When discussing a coordinate frame at a point on a surface, there is one normal direction and two tangent directions, which should be called the tangent and bitangent."


As the author of that passage, I'm happy to see that people are agreeing with the terminology.

As for transforming the TBN frame, if your transformation matrix is orthogonal, then you can simply use that matrix to transform all three vectors. However, if it's not orthogonal, then you can only use it to transform the tangent and bitangent vectors. The normal vector must be transformed with the inverse transpose of the matrix in order for it to remain perpendicular to the transformed tangents (assuming it was perpendicular in the first place).

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