From 43e2df8d4a38a027465fd7190e624c4641742b08 Mon Sep 17 00:00:00 2001 From: Brendan Matkin Date: Sun, 26 Jan 2014 01:28:05 -0500 Subject: [PATCH] SimpleOpenNI 2+ Hid potentially-conflicting libraries from Processing, updated user.pde and KinectToPin.pde, and modified settings.txt --- User.pde | 172 ++++++++++-------- .../SimpleOpenNI.jar | Bin .../SimpleOpenNI32.dll | Bin .../SimpleOpenNI64.dll | Bin code/{ => probably_unnessecary}/export.txt | 0 .../libSimpleOpenNI.jnilib | Bin .../libSimpleOpenNI.so | Bin .../libSimpleOpenNI32.so | Bin .../libSimpleOpenNI64.so | Bin settings.txt | 6 +- 10 files changed, 97 insertions(+), 81 deletions(-) rename code/{ => probably_unnessecary}/SimpleOpenNI.jar (100%) rename code/{ => probably_unnessecary}/SimpleOpenNI32.dll (100%) rename code/{ => probably_unnessecary}/SimpleOpenNI64.dll (100%) rename code/{ => probably_unnessecary}/export.txt (100%) rename code/{ => probably_unnessecary}/libSimpleOpenNI.jnilib (100%) mode change 100755 => 100644 rename code/{ => probably_unnessecary}/libSimpleOpenNI.so (100%) mode change 100755 => 100644 rename code/{ => probably_unnessecary}/libSimpleOpenNI32.so (100%) mode change 100755 => 100644 rename code/{ => probably_unnessecary}/libSimpleOpenNI64.so (100%) mode change 100755 => 100644 diff --git a/User.pde b/User.pde index 10bde2c..13920a9 100644 --- a/User.pde +++ b/User.pde @@ -1,44 +1,66 @@ /* -------------------------------------------------------------------------- * SimpleOpenNI User Test * -------------------------------------------------------------------------- - * Processing Wrapper for the OpenNI/Kinect library + * 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: 02/16/2011 (m/d/y) + * prog: Max Rheiner / Interaction Design / Zhdk / http://iad.zhdk.ch/ + * date: 12/12/2012 (m/d/y) * ---------------------------------------------------------------------------- */ -void setupUser(){ - if(multiThread){ - context = new SimpleOpenNI(this,SimpleOpenNI.RUN_MODE_MULTI_THREADED); - }else{ - context = new SimpleOpenNI(this); +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(); + +void setupUser() +{ + if (multiThread) { + context = new SimpleOpenNI(this, SimpleOpenNI.RUN_MODE_MULTI_THREADED); + } + else { + context = new SimpleOpenNI(this); } //context = new SimpleOpenNI(this); - context.setMirror(mirror); //mirrors view but not joint names; that must be done separately - + context.setMirror(mirror); //mirrors view but not joint names; that must be done separately + + 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(SimpleOpenNI.SKEL_PROFILE_ALL); - - background(200,0,0); + context.enableUser(); + + background(200, 0, 0); - stroke(0,0,255); + stroke(0, 0, 255); strokeWeight(3); //smooth(); - - //size(context.depthWidth(), context.depthHeight()); } -void drawUser(){ +void drawUser() +{ // update the cam context.update(); - + // draw depthImageMap + //image(context.depthImage(),0,0); + image(context.userImage(), 0, 0); + ///*---------- instead of context.userImage() ???? if(modePreview){ if(camDelayCounter