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

Event-based reading of users' data

You don't need to call nite::UserTracker::readFrame() and wait for it to return each time you want to read a frame of data from nite::UserTracker. This is because NiTE developers give us this ability to define a callback (also known as event listener) when a new frame becomes available, just as openni::VideoStream does. In this recipe, we are going to cover this feature and rewrite the first recipe of this chapter, this time based on events.

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++.

How to do it...

  1. Add the ReadLastCharOfLine() function from previous recipes to the top of your ...

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