O'Reilly logo

Augmented Reality with Kinect by Rui Wang

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

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

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