Getting started with Microsoft Kinect SDK - The Full Skeleton |
Written by Mike James | ||||
Monday, 23 January 2012 | ||||
Page 3 of 3
Drawing a Boneit should be obvious that what we have to do next is draw a line between ShoulderCenter and Spine. Clearly this is just a repeat of what we have already done so this suggests another helper function: void DrawBone(JointID j1, This will draw a line between the two specified Joints. So to draw the body all we need is: DrawBone(JointID.Head, This is all we need! If you run the program now you will see lines following the body. Now that you have seen this much adding two legs should be easy: //Left leg
All we have left to do is to add the two arms: //Left Arm Now if you run the program you will see a complete skeleton plot. You can argue that there are better ways to organize the code but you have to have a list of the joints you want to draw lines between somewhere. If you want to try taking it further why not change the drawing of the head for an ellipse and a rectangle for the body. It is all fairly easy. Articles on the Microsoft Kinect SDK
Next Time: Audio
You can download the code for the Windows Forms version of this program from the CodeBin (note you have to register first).
Comments
or email your comment to: comments@i-programmer.info
To be informed about new articles on I Programmer, subscribe to the RSS feed, follow us on Google+, Twitter, Linkedin or Facebook or sign up for our weekly newsletter. |
||||
Last Updated ( Monday, 06 February 2012 ) |