Search code examples
rotationtranslationpose

Find rotation and translation from one 3D point to another


I'm having the following problem: An algorithm is providing 3D poses in time, each described by a translation vector and a quaternion. The initial origin of this coord system is (0,0,0), rotation 0.

Now I would like to make one arbitrary pose of that stream "the kings" pose now, aka the origin of my new coordinate system. In my humble imagination I think, that it would be sufficient to apply a translation and rotation for every new incoming "old" coordinate into the new coord system by the translation/rotation derived at the time of fixing the new origin. But I have no idea, how to achieve that mathematically.

Any pointer welcome. Thanks.


Solution

  • I think it would suffice to subtract the coords of the new "kings pose" from incoming coordinates to achieve the translation. Could also help to have a "origin" vector stored on the object owning the poses with a default of (0,0,0) and subtract it from all incoming coords anyway so all you would have to do is set/clear the origin to change the "Kings Pose". Hope this helps