I have tried to move the head of my character with my own head for many hours but it doesn’t work.
I use the file given by OpenNI (https://github.com/OpenNI/UnityWrapper/blob/master/UnitySampleProject/Assets/Nite.cs ) but in all videos I have seen, the head doesn’t rotate. Is it possible to rotate it with openNI? What advice could you give me?
As far as I know OpenNI does not provide head tracking at the moment. The Neck and Head joint rotations seem to be fixed.
OpenNI and NITE doesn’t currently do head rotations. It tracks the head as a blob and gives you center of mass. We are using kinect with Unity and cobbled an additional solution and are using a webcam and a tracking API for head rotations which are added to the skeleton/body positions and rotations by the kinect.
We hope to investigate the recently released Microsoft SDK to see if that is any better and it looks like it might be, but doesnt look like it gives head rotations either.
Our solution with a webcam and face tracking software (especially with the Logitech driver with Face Follow) works fine tracking the head rotations even from 3 meters away from with the webcam with the Kinect does all the heavy lifting for the body.
I have another question. I tried to move the root of my character when I crouched down. (now, it is my legs which move)
I tried this code :
void MoveBone(uint userId, NiteWrapper.SkeletonJoint joint, Transform dest)
NiteWrapper.SkeletonJointTransformation trans = new NiteWrapper.SkeletonJointTransformation();
NiteWrapper.GetJointTransformation(userId, joint, ref trans);
Vector3 v3pos = new Vector3(trans.pos.x, trans.pos.y, -trans.pos.z);
dest.position = (v3pos * Scale) - rootPosition;
(rootPosition is null for the moment)
But the scale makes me crazy, my character go out and the root moves good and if I don’t use the scale, it doesn’t work…
Someone could help me please?
Sorry for my bad english:-(