Book Image

Augmented Reality with Kinect

By : Rui Wang
Book Image

Augmented Reality with Kinect

By: Rui Wang

Overview of this book

Microsoft Kinect changes the notion of user interface design. It differs from most other user input controllers as it enables users to interact with the program without touching the mouse or a trackpad. It utilizes motion sensing technology and all it needs is a real-time cameras, tracked skeletons, and gestures. Augmented Reality with Kinect will help you get into the world of Microsoft Kinect programming with the C/C++ language. The book will cover the installation, image streaming, skeleton and face tracking, multi-touch cursors and gesture emulation. Finally, you will end up with a complete Kinect-based game. Augmented Reality with Kinect will help you get into the world of Kinect programming, with a few interesting recipes and a relatively complete example. The book will introduce the following topics: the installation and initialization of Kinect applications; capturing color and depth images; obtaining skeleton and face tracking data; emulating multi-touch cursors and gestures; and developing a complete game using Kinect features. The book is divided in such a way so as to ensure that each topic is given the right amount of focus. Beginners will start from the first chapter and build up to developing their own applications.
Table of Contents (14 chapters)
Augmented Reality with Kinect
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Drawing the linetrails following the hands


Now let's start to develop a very important part of our Fruit Ninja game: the knives that cut any coming fruits. Our hands can simulate the knives very well here, because in a motion-sense environment, they are always the most agile and accurate objects to operate on anything in space.

It will be easy to know the per-frame positions of the two hands as shown in the previous example. But it is also a good idea to add some trailing effects to demonstrate how fast and sharp the knives are, and to indicate to the players where their weapons are. In this example, we will emulate these trails with a series of continuous line segments. The alpha values of each line segment can also change so that the entire trail seems to fade out at the end.

Drawing the path for specified joints

To implement linetrails of two hands, we have to use a dynamic array to store historical points that the hands have moved to. We then connect them to implement the line-trail effect...