PDA

View Full Version : tangent space



giuseppe500
03-15-2012, 04:24 AM
Hello.
I have a matrix that rotates a set of points on a plane around a direction that is the normal of the plane.
my problem is to find how these point are rotated around the normal and find an angle of rotation of these points about the normal direction.
These points are a profile.
I tried to do this with creating of a matrix that transform my basic points in a tangent space, like the bump mapping .
Then i calculated the tangent,the normal and the binormal and i have create a matrix like:

T;T;T
B;B;B
N;N:N

N is calculated with the cross product of two edge of the profile(i use tree point of the profile that are not in line)
T is N rotated of 90 °(degree) swap the z with y and negate y.
B is the cross product of T and N.



This matrix transforms in a tangent space.
But In tangent space how i can calculate the angle about the normal direction of the plane?
result of the matrix rotation?

mine is a sound approach?
because i can't find the correct angle!

thanks.

thokra
03-20-2012, 03:37 AM
Well, if you know the initial and the final direction, why not normalize both vectors, take the dot product and compute the acos of the former?

Edit: Just to be clear, to really determine the angle in [0, 360] you also need to employ the sinus. This can be done using the relationship of the sinus and the cross product!