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 ...
Get Making Things See now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.