From the Kinect, I was able to get the vectors
kShoulder = Neck->Shoulder, kUpArm = Shoulder->Elbow and kForeArm = Elbow to Hand.
Then I follow this code to get the rotation for the foreArm joint.
I use the quaternion.h from Irrlicht 1.8 SDK so I believe the toEuler bug has been fixed.
However the result is weird. Only some positions are mirrored correctly.
Can soneone help me find anything wrong with my approach?
Code: Select all
core::quaternion lElbowRotationQ;
vector3df lElbowRotationEuler;
vector3df lElbowRotationDeg;
lElbowRotationQ.rotationFromTo(kForeArmL,kUpArmL);
lElbowRotationQ.normalize();
lElbowRotationQ.toEuler(lElbowRotationEuler);
lElbowRotationDeg = lElbowRotationEuler * core::RADTODEG;
foreArmL->setRotation(lElbowRotationDeg);