O'Reilly logo

Making Things See by Greg Borenstein

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

Project 6: Invisible Pencil

This application is going to take the tracking interface we created in the last section and turn it into a drawing program. We’ll still track the closest point that the Kinect can see, but now instead of simply displaying it as a circle on top of the depth image, we’ll use that point to draw a line.

To draw a line in Processing, you need two points. Processing’s line function takes four values: the x- and y-coordinates of the first point followed the x- and y-coordinates of the second point. It draws a line on the screen that connects these two points that you give it. To transform our closest point tracking code into drawing code, we’ll need to draw a line on each frame instead of a circle. And we’ll want our line to ...

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