In anticipation of a beach-based Spring Break, and as a test for a final project idea, I created this openFrameworks / Kinect application that gave me the ability to play with and stretch/compress a beach photo between my hands and over my body. The code is based on the “Air Accordion” example that I got from Eric Mika. I loaded one of my old beach photos, and mapped the x/y positions of it, along with the width/height, in relation to my hand x/y positions.

I wanted to be able to measure the distance between points in 3D versus just 2D, so Eric wrote a function called “dist3D(ofPoint a, ofPoint b)” based on a formula I found online. I utilized this in the variables I created for distance3D, lastDistance3D, and velocity3D. I used the velocity3D variable to try to control the playback of a sound file. I also wanted to be able to rotate the photo in 3D and “extrude” the pixels, but I was not able to get this working. I also tried drawing a box and a sphere with the photo texture-mapped onto it, but those attempts didn’t work either. I deleted all the commented-out code that didn’t work, so the file inserted into this post is clean. (You’ll have to copy the “openni” folder, that in turn contains the “config” and “lib” folders, into the “data” folder that is inside the “bin” folder of the project in order to run this.) GoingToTheBeach

« »