Create your own joints data point

As we discussed, JointCollection is limited to a maximum of 20 joints as the Kinect for Windows SDK can support a maximum of 20 joints tracks. But if you want to create your own data point (not new joint) for a skeleton joint you can use the following approach where you can first create a skeleton point with respective positions for the x, y, and z axis:

SkeletonPoint position; 
position.X = 1.1f;
position.Y = -1.1f;
position.Z = 1.8f;

Once the position is defined, create a joint point and assign the joint position with the previously created joint point:

Joint joint;
joint.Position = position;
joint.JointType= JointType.Head;
joint.TrackingState = JointTrackingState.Tracked;

In the end assign the joint the value of the respective joint type. As per this example we have assigned the position for the Head joint within collection:

JointCollection collection = new JointCollection();
collection[JointType.Head] = joint;

You can use this approach to set a joint point to a specific location and then use the same joint once the sensor tracks the skeleton.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.15.1