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
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Augmented Reality with Kinect

You're reading from   Augmented Reality with Kinect If you know C/C++ programming, then this book will give you the ability to develop augmented reality applications with Microsoft's Kinect. By the end of the course you will have created a complete game.

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

Locating the cursors


In the first example of this chapter, we will convert the two hand bones into cursors to simulate a multitouch-like behavior. While the hand positions are changing, the cursors will also move so that we can locate them on a certain object, such as a button or a menu item. The available range of the hand positions must be limited here, otherwise the result will be confusing if we drop the arms and don't want the cursor to move again.

Drawing cursors from two hands

The line-trailing example in the previous chapter is a good start for our new task, so we will work on this example to add cursor support based on user-skeleton data we have already obtained. The steps are given as follows:

  1. Define arrays to store necessary hand positions, as well as the colors to display in the window. We also declare a smoothParams variable here, which will be introduced later.

    NUI_TRANSFORM_SMOOTH_PARAMETERS smoothParams;
    GLfloat cursors[6];  // Left hand: 0, 1, 2; Right: 3, 4, 5
    GLfloat cursorColors...
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