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

Cutting the fruits

Now we really want to "cut" something instead of just seeing the trailing effect. To simplify the process, we should have the following prerequisite conditions:

  • The fruit and bomb objects are represented by a 2D RGBA image with a transparent background. The positions and states (whether sliced or not) are updated in every frame.
  • The fruit is thrown from the bottom of the screen with a random initial velocity. It will fall down because of gravity.
  • When the hand points reach the object image (in fact, a rectangle), it is divided into four parts as if sliced by a mystical ninja.

The code doesn't need to be related with Kinect, but we will have to pass the hand points and velocities to determine if a fruit object is cut. All these operations ...

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