Advertisement

transformation

Started by September 27, 2001 04:26 AM
0 comments, last by nckchan 23 years, 4 months ago
Hi all, Suppos the camera is facing to the direction (-1, 0, 0) of the world coordinate system. If I want to rotate the camera along the x-axis of the camera coordinate system (i.e. The z-axis of the world coordinate system). How can I transform the rotation axis in local coordinate system into the world coordinate system? Thx, William chikit
chikit
I don''t know if this will help or not, but...

If you have three vectors representing the axes of one coordinate system, A, in terms of a second one, B, then you can convert a vector in A to B by by multiplying each component of the vector by the corresponding axis and adding the results together. You can convert a vector in B to A by taking the dot product of each component with the corresponding axis, dividing by the square of the magnitude of the axis vector and using the resulting scalar as the corresponding component of the vector in A.

So for example if you had vectors i=(1,0,0), j=(0,2,0) and k=(0,0,3) representing the axes of coordinate space A in terms of B then the vector (4,5,6) in A would be 4*(1,0,0)+5*(0,2,0)+6*(0,0,3) or (4,10,18) in terms of B. Putting it back in A would be (((4,10,18)*(1,0,0))/1, ((4,10,18)*(0,2,0))/4, ((4,10,18)*(0,0,3))/9) or (4, 5, 6).
Keys to success: Ability, ambition and opportunity.

This topic is closed to new replies.

Advertisement