commit d89cb0ed8a622a405476bc5a56b372d7c0273f75 Author: James Devine Date: Wed Jun 27 21:35:00 2018 +0200 diff --git a/skelworking.pde b/skelworking.pde new file mode 100644 index 0000000..5df5799 --- /dev/null +++ b/skelworking.pde @@ -0,0 +1,223 @@ +/* -------------------------------------------------------------------------- + * 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