181
Support / Rotate an object to match another object's rotation matrix
« on: October 20, 2011, 09:43:32 am »
I have two Matrices;
1) object3D1: The source Object3D rotational matrix (getRotationMatrix())
2) object3D2: The destination Object3D rotational matrix (getRotationMatrix())
I would like to slowly rotate the source object to match the rotation matrix of the destination object frame by frame, so both rotations are exactly the same (both objects are facing the same way).
I'm guessing I can use object3D1.getZAxis() and object3D2.rotateAxis() but how do you do the calculations?
Or can I use Matrix.interpolate()?
1) object3D1: The source Object3D rotational matrix (getRotationMatrix())
2) object3D2: The destination Object3D rotational matrix (getRotationMatrix())
I would like to slowly rotate the source object to match the rotation matrix of the destination object frame by frame, so both rotations are exactly the same (both objects are facing the same way).
I'm guessing I can use object3D1.getZAxis() and object3D2.rotateAxis() but how do you do the calculations?
Or can I use Matrix.interpolate()?