This may be a question that some of you can answer quickly, but I have been picking my brain for a week now and cannot seem to figure it out...
 
How do I calculate one (exactly one) Transform3D (or Quat4f) to go from a global coordinate system to a local coordinate system (or the other way around)?
 
I am supplying xyz-data for 3 points (collected externally). These 3 points define the location and orientation of a segment (upper leg or lower leg in my case) in a global coordinate system. This is the case because the relationship between these 3 points in the real world do not change. To visualize the location and orientation of the segment in my application I would like to align an object (bone) on the axis between points 1 and 2, and then use point 3 to define the segment's orientation around this axis.
 
I think I should be able to have exactly one quaternion or rotation matrix to define the orientation of the segment, but how can I calculate it? I already know how to align the object between points 1 and 2, but I cannot figure out how to use point 3 to determine the segment's rotation around its longitudinal axis. I would like to avoid Euler angles because of gimbal lock and sequence-dependency problems.
 
I searched the archives and the web, but nothing comes up so far.
 
Any help or pointers would be greatly appreciated.
 
Regards - Rudolf Buijs

Reply via email to