Getting a user's skeleton joints and displaying their position in the depth map
In this recipe, we are going to show you how to request calibration for a user's skeleton and for tracking a user's skeleton joints; we will then show these joints on a screen overlaying the depth stream.
Getting ready
Create a project in Visual Studio and prepare it for working with OpenNI and NiTE using the Create a project in Visual Studio 2010 recipe in Chapter 2, OpenNI and C++; then, configure Visual Studio to use OpenGL using the Configuring Visual Studio 2010 to use OpenGL recipe in Chapter 3, Using Low-level Data.
Then copy the code from the Identifying and coloring users' pixels in depth map recipe of Chapter 5, NiTE and User Tracking to this project.
How to do it...
Locate the following line in the
gl_DisplayCallback()
function:glEnd();
Add the following lines of code relative to the preceding line:
glBegin( GL_POINTS ); glColor3f( 1.f, 0.f, 0.f ); const nite::Array<nite::UserData>&users...