- Home /
unity + openNI + kinect : head tracking
Hello,
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?
Thanks.
Answer by psdev · Jul 05, 2011 at 12:15 AM
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.
Answer by gayelle85 · Jun 27, 2011 at 03:43 PM
Thanks.
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?
Thanks!!
Sorry for my bad english:-(
Please don't post questions as answers. Start a new question thread ins$$anonymous$$d. (And mark an answer as accepted if it has answered your question.) ;)
W.r.t. your question. I'm not sure what you need, the scale of the $$anonymous$$inect positions is in mm. if that helps, while 1 unit in Unity is 1 meter.
Answer by CvW · Jun 23, 2011 at 03:05 PM
As far as I know OpenNI does not provide head tracking at the moment. The Neck and Head joint rotations seem to be fixed.
Your answer
Follow this Question
Related Questions
Head tracking for mac with Kinect 1 Answer
Unity: Wii Remote Infrared Head Tracking (Johnny Lee) 0 Answers
add force in ball when i kick the ball 2 Answers
kinect questions 0 Answers
Using 2 Kinects with skeletons 0 Answers