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 hands' data

In the preceding recipes, we use a while loop to read frames of data from nite::HandTracker. This is not a good idea since this will block our application and even the while loop itself until new data becomes available. Fortunately, NiTE has given us this ability to introduce a class/struct with a method in it to be called when a new frame of data becomes available. So our application can do what we want it to do and, when new data becomes available, we can read it without busying our main application thread. In this recipe, we will show you how to use this feature.

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

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