View Full Version : world space to tangent space to world space point

10 October 2005, 10:35 PM
Let's say I have a point position in space and a TBN matrix, defined by the tangent, binormal and the normal vector for that particular point on a 3d surface. How can I convert that point from world space to tangent space and vice-versa, from tangent space back to world space, after modifying its position in the tangent space? Can I simply convert it just like a normalized vector, or there's a special catch for this kind of conversion? More exactly, I want to make the deformations in the tangent space, for mapping reasons, but after deforming it, I want to take it back to world space. I know how to deal with normalized vectors, but in my case, I have a 3d position, a vector that's not necessary normalized. Do you guys have any idea?

10 October 2005, 06:54 AM
Theres a catch.... to transform a vector as if its a point you will have to do your matrix multiplication using a homogeneous vector. If you have a decent vector math library its often as straightforward as setting the fourth 'w' component to one (instead of zero for vector multiplication). Also, some libraries define different types for points and vectors in which case the value of 'w' is implicit, the advantage being that you only need to worry about three components instead of four.


CGTalk Moderation
10 October 2005, 06:54 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.