Which matrix is the best to rotate a bone?

Started by Tangomajom, April 19, 2016, 10:18:48 AM

Previous topic - Next topic

Tangomajom

Hi,

Maybe this sounds a bit stupid, but I can't find out by myself.
So I would like to apply an Euler rotation based animation to my imported rigged model. The animation in the Collada file is played correctly, but I would like to create the same animation programatically.

My idea is to create a quaternion from the original rotation of the bone, and then I'll use the Quaternion.rotateX/Y/Z methods, and then this modified quaternion will go to the JointChannel.
The only question is that how can I reach the current rotation matrix of the bone, to create the good quaternion from it.

I tried to use the SkeletonHelper.getBoneDirection(animatedJoint).getRotationMatrix(), and also the animatedObject.get(0).getSkeletonPose().getLocal(animatedJoint.getIndex()).getTranslation().getRotationMatrix(), and they inverts as well, but none of them produced the expected result.

Please give an advise.

Thanks in advance,

raft

to get the rotation quat:

new Quaternion(SkeletonPose.getLocal(<index>))

and for sure that means, SkeletonPose.getLocal(<index>) actually contains the rotation information.