/* -------------------------------------------------------------------------- * SimpleOpenNI User Test * -------------------------------------------------------------------------- * Processing Wrapper for the OpenNI/Kinect 2 library * http://code.google.com/p/simple-openni * -------------------------------------------------------------------------- * prog: Max Rheiner / Interaction Design / Zhdk / http://iad.zhdk.ch/ * date: 12/12/2012 (m/d/y) * ---------------------------------------------------------------------------- */ import SimpleOpenNI.*; SimpleOpenNI context; color[] userClr = new color[]{ color(255,0,0), color(0,255,0), color(0,0,255), color(255,255,0), color(255,0,255), color(0,255,255) }; PVector com = new PVector(); PVector com2d = new PVector(); PVector v1 = new PVector(); PVector v2d = new PVector(); float dontcare; void setup() { size(640,480); context = new SimpleOpenNI(this); if(context.isInit() == false) { println("Can't init SimpleOpenNI, maybe the camera is not connected!"); exit(); return; } // enable depthMap generation context.enableDepth(); // enable skeleton generation for all joints context.enableUser(); background(200,0,0); stroke(0,0,255); strokeWeight(3); smooth(); } void draw() { // update the cam context.update(); // draw depthImageMap //image(context.depthImage(),0,0); image(context.userImage(),0,0); // draw the skeleton if it's available int[] userList = context.getUsers(); for(int i=0;i