Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
OpenNI Cookbook

You're reading from   OpenNI Cookbook Learn how to write NIUI-based applications and motion-controlled games

Arrow left icon
Product type Paperback
Published in Jul 2013
Publisher Packt
ISBN-13 9781849518468
Length 324 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Soroush Falahati Soroush Falahati
Author Profile Icon Soroush Falahati
Soroush Falahati
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

OpenNI Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started FREE CHAPTER 2. OpenNI and C++ 3. Using Low-level Data 4. More about Low-level Outputs 5. NiTE and User Tracking 6. NiTE and Hand Tracking 7. NiTE and Skeleton Tracking Index

Designing a simple pong game using skeleton tracking


We will use the output of skeleton tracking on a simple game to show you how we can use this data to make the user a bigger part of the game than he was in old times. This pong-like game is the simplest game we could think of.

Unfortunately because of the number of lines of code, we removed the How to do it... section, but you can download the source code of this recipe from Packt Publishing's website.

Also, in the How it works... section that follows, you can read information about almost every line of code.

How it works...

The gameplay is fairly simple; we have a pong-like ball that can interact with a user's skeleton. It is not a great game, but it's still a game, and it is fun enough as a mini-game from a personal perspective.

If you'll take a look at the code (the main file is OpenNI2Project.cpp), you can clearly see that we used two new #include lines. vector helps us to define arrays with dynamic-size behavior that we are going to use...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image