I have 6 unit vectors (representing the X/Y/Z axis) of 2 arbitrary coordinate systems. The vector values of the second coordinate system are based on the first system. I need to rotate one system into the other and return the matching quaternion. What would be the most reasonable way to do this in c++?
There are a number of posts on SO talking about converting y-up/z-up/left-/right-handed systems into each other, unfortunately I need this to be a generic solution for any 6 unit vectors. Thanks for any insights.
3 orthogonal vectors it is probably rotation matrix 3x3. You can build 2 matrices and find relative rotation as r_relative = r1.transpose() * r2;
Than convert matrix to quaternion using any tested lib.
Or convert both rotations to quaternion and
q_relative = q1.inverted() * q2;