O'Reilly logo

OpenNI Cookbook by Soroush Falahati

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Controlling the player when opening a device from file

In this recipe we want to introduce you to a new class, OpenNI::PlaybackControl. Using this class, you can seek a frame as well as repeat and change the speed of playback easily.

Getting ready

Create a project in Visual Studio 2010 and prepare it for working with OpenNI using the Creating a project in Visual Studio 2010 recipe of Chapter 2, Open NI and C++. After that, configure Visual Studio 2010 to use OpenGL using the Configuring Visual Studio 2010 to use OpenGL recipe of this chapter.

How to do it...

  1. Add the following lines above your source code (just below the #include lines):
    int window_w = 640; int window_h = 480; OniRGB888Pixel* gl_texture; VideoStream depthSensor; Device device; PlaybackControl* ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required