Bones - Skeletal and Pose Animations for jPCT/jPCT-AE > Bones

Which matrix is the best to rotate a bone?

(1/1)

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:


--- Code: ---new Quaternion(SkeletonPose.getLocal(<index>))
--- End code ---

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

Navigation

[0] Message Index

Go to full version