Hello everyone!
I plan to use the Kinect v2 (that for xboxOne) to move an avatar in my scene.
My idea was to gain the quaternions of jointOrientations and then change the appropriate bone matrix.
Nevertheless, the jointOrientations are expressed in global rotations (each jointOrientation indicates the direction of the joint in absolute coordinates) while, if I understand it, I can only modify the local matrix of skeleton bone.
So I am trying to convert local jointOrientation in local rotation:
So I am trying to convert local jointOrientation in local rotation:
var joint; //the joint of kinect var parent = joint.Parent(); var localOrientation = BABYLON.Quaternion.Inverse(parent.Orientation).Multiply(joint.Orientation);
But I'm having trouble in the transformation of the reference coordinate between kinect joints and avatar bones int the babylon scene...
I tried to change the axes by swapping values (x, y, z), but I'm probably wrong
var kinectOrientation; //orientation of the joint expressed in quaternion return new BABYLON.Quaternion(kinectOrientation.y, kinectOrientation.x, kinectOrientation.z, kinectOrientation.w); //this is just one example, I have tried in different cases
Do you have any advice?
Thanks in advance