During the last days I finally got to work with Microsoft’s Kinect X360. The book Making Things See by Greg Borenstein helped me a lot getting introduced into the technology and code lines. I only wished there were books already that deal with openFrameworks and the Kinect. I haven’t found any specific one so far …

I used Greg’s point cloud example and added some basic interaction to it, so the user is able to influence the rotation of the displayed image.
Edit: I did this before reading further in the book. I recognised that Greg also added interaction in the further process. Though, my outcome is a little different from his as the image keeps spinning without requiring the user to act for that. However, the user might interfere and influence the rotation by moving the mouse. In Greg’s example the only spinning is caused by a mouse movement – if there is no input the rotation stops.

Me lying on the couch – front view


Kinect’s actual perspective



import processing.opengl.*;
import SimpleOpenNI.*;

SimpleOpenNI kinect;

float rotation = 0;

void setup()
  size(1024, 768, OPENGL);
  kinect = new SimpleOpenNI(this);

void draw()
  translate(width/2, height/2, -1000);
  translate(0, 0, 1000);
  PVector[] depthPoints = kinect.depthMapRealWorld();
  for(int i=0; i < depthPoints.length; i+=10)
    PVector currentPoint = depthPoints[i];
    point(currentPoint.x, currentPoint.y, currentPoint.z);

// added for interaction
void mouseMoved()
  rotation = map(mouseX, 0, width, 0, 360);