Reading and showing a frame from the depth sensor
Who doesn't agree that the output of the depth sensor is the most important output of OpenNI and compatible devices? In this recipe, we will show you how to use OpenGL and OpenNI to show OpenNI's depth sensor output to the user.
We highly recommend reading the previous recipe of this chapter, Reading and showing a frame from the image sensor (color/IR), to have a background about how we can use OpenGL to show a picture to the user and how we can copy a picture from OpenNI to our texture buffer with resizing on-the-fly; especially the How it works… section, as we are not going to cover all the lines in detail in this recipe (as we did in the previous recipe). But don't worry. This recipe is simpler than the last one—at least at first glance!
Getting ready
Create a project in Visual Studio 2010, prepare it for working with OpenNI using the Create a project in Visual Studio 2010 recipe of Chapter 2, Open NI and C++, and then configure Visual Studio...