Share via


Skeleton Basics-D2D C++ Sample

Kinect for Windows 1.5, 1.6, 1.7, 1.8

Overview

When you run this sample, you see the following:

  • Skeleton tracking for up to two players standing in front of the Kinect; 20 joints per skeleton are rendered.
  • A checkbox for seated mode. If you select this, you will see skeleton tracking for up to two players while seated; 10 joints per skeleton are rendered.
The Sample Uses the Following APIs To Do This
NuiGetSensorCount function Get the number of sensors that are plugged in and ready for use.
NuiCreateSensorByIndex function and INuiSensor interface Create an interface that represents a connected sensor.
INuiSensor::NuiStatus method Check the sensor status to see if the sensor is connected.
INuiSensor::NuiInitialize method and NUI_INITIALIZE_FLAG_USES_SKELETON constant Initialize the sensor to stream out skeleton data.
CreateEvent function Create an event that will be signaled when skeleton data is available by returning an event handle.
INuiSensor::NuiSkeletonTrackingEnable method and the event handle Enable skeleton tracking.
NUI_SKELETON_FRAME structure and INuiSensor::NuiSkeletonGetNextFrame method Get a frame of skeleton data.
INuiSensor::NuiTransformSmooth method Smooth the skeleton data using a matrix transformation.
NUI_SKELETON_TRACKING_STATE enumeration Check a joint to see if it is tracked.
NuiTransformSkeletonToDepthImage function Convert points from skeleton space to depth space so you can position the skeleton on screen.
NUI_SKELETON_POSITION_TRACKING_STATE enumeration For each frame of skeleton data, use the enumeration value to distinguish a tracked joint (NUI_SKELETON_POSITION_TRACKED) from an untracked (NUI_SKELETON_POSITION_NOT_TRACKED) or an inferred (NUI_SKELETON_POSITION_INFERRED) joint.
NuiShutdown function Turn the sensor off.

To run a sample you must have the Kinect for Windows SDK installed. To compile a sample, you must have the developer toolkit installed. The latest SDK and developer toolkit are available on the developer download page. If you need help installing the toolkit, look on this page: To Install the SDK and Toolkit. The toolkit includes a sample browser, which you can use to launch a sample or download it to your machine. To open the sample browser, click Start > All Programs > Kinect for Windows SDK [version number] > Developer Toolkit Browser.

If you need help loading a sample in Visual Studio or using Visual Studio to compile, run, or debug, see Opening, Building, and Running Samples in Visual Studio.