PDA

View Full Version : TangentSpace -> WorldSpace



Jan
04-14-2004, 01:57 PM
Hi

This might be a stupid question, but well, i donīt know the answer.

If i have a normalmap which represents the normals in tangent-space, then how would i need to transform those vectors to have them in world-space?

I was thinking i would simply need to take the inverse of the TBN-Matrix (which i would use to get other stuff into my tangent-space). However i am not sure if this would work.

And additionally i donīt know how to get that inverse! I know how to calculate it on a piece of paper, but i donīt know how to teach my cpu that algorithm ;)

So, i would either need to know how to calculate that inverse, or how to do this in another way.

Thanks,
Jan.

Tom Nuydens
04-14-2004, 10:17 PM
If the TBN matrix is orthonormal (i.e. the three vectors are normalized and perpendicular to each other), then the inverse of the matrix is simply its transpose.

If the matrix isn't orthonormal, see the Matrix and Quaternion FAQ (http://skal.planet-d.net/demo/matrixfaq.htm#Q23) .

-- Tom

Jan
04-15-2004, 06:35 AM
Cool, thanks.

Yes, itīs orthogonal.

Jan.