I have a Skeleton skeleton which comes from the SkeletonFrameReady event. And I have a function to draw skeletons on the windows,
void DrawSkeleton(Skeleton s),
which takes the Skeleton as the input and draws 2D image of skeleton to my window.
Now, I want to change, for example, x and y value of the right hand and draw it on the window using the same function, void DrawSkeleton(Skeleton s).
However, when I try to do something like:
skeleton.Joints[JointType.HandRight].Position.X = 3;
It doesn’t allow me to do that:
Cannot modify the return value of ‘Microsoft.Kinect.Joint.Position’ because it is not a variable.
which is probably because Position is not a variable, is a property.
Question:
How can I duplicate a Skeleton object and change the Position values of Joints on that object.
Yes you can.
You simply make a new Position object and overwrite the Position you like.
This is an example from an actual project where we wanted to correct the position of the hand to adjust the mouse without actually modifying the skeleton