From 39bcb5346b1f746399192391b6699e81d0d8ad3a Mon Sep 17 00:00:00 2001 From: Comment Date: Thu, 20 Jun 2013 09:06:40 +0100 Subject: spooky bug fixed, integration nearly right --- 04_playobjects/src/testApp.h | 53 +++++++++----------------------------------- 1 file changed, 10 insertions(+), 43 deletions(-) (limited to '04_playobjects/src') diff --git a/04_playobjects/src/testApp.h b/04_playobjects/src/testApp.h index 873db31..270245d 100644 --- a/04_playobjects/src/testApp.h +++ b/04_playobjects/src/testApp.h @@ -1,11 +1,8 @@ #ifndef _TEST_APP #define _TEST_APP -#include "ofxOpenNI.h" #include "ofMain.h" #include "ofxXmlSettings.h" -#include "ofxMayaCam.h" - #include "ofxOsc.h" #define OSCPORT 12345 @@ -20,12 +17,8 @@ struct record{ //in order to play different clips it seems necessary to have a player per clip class syncOniPlayer{ public: - int depthW; - int depthH; syncOniPlayer() { drawable=false; - depthW=320; - depthH=240; } ~syncOniPlayer(){ stop(); @@ -86,48 +79,21 @@ class syncOniPlayer{ players[i]->drawDepth(50, 0,520,390); players[i]->drawImage(600, 0,520,390); - int count; - for (int i=0;igetDepthGenerator().GetDepthMap(); - //uint16_t* depthpixels=depthmap.getPixels(); - int range=2500; - - for (int i=0;iprojectiveToWorld(ofPoint(i,j,(float)(depthmap[j*depthW+i]))); - //ofPoint p= projectiveToWorld(ofPoint(i,j,(float)depthmap[j*dmw+i])); - - //if (p.z == 0 || p.z>range) continue; // gets rid of background - - - //glColor4ub((unsigned char)255, (unsigned char)255, (unsigned char)255, (unsigned char)255); - //glVertex3f(p.x, p.y, p.z); - //if (i==320&&j==160) cerr<<"world point: "<getDepthGenerator().GetDepthMap(); + const XnDepthPixel* depthmap=players[n]->getDepthGenerator().GetDepthMap(); //uint16_t* depthpixels=depthmap.getPixels(); int range=2500; + + int depthW=players[n]->getWidth(); + int depthH=players[n]->getHeight(); for (int i=0;iprojectiveToWorld(ofPoint(i,j,(float)(depthmap[j*depthW+i]))); + ofPoint p= players[n]->projectiveToWorld(ofPoint(i,j,(float)(depthmap[j*depthW+i]))); //ofPoint p= projectiveToWorld(ofPoint(i,j,(float)depthmap[j*dmw+i])); - //if (p.z == 0 || p.z>range) continue; // gets rid of background + if (p.z == 0 || p.z>range) continue; // gets rid of background - //glColor4ub((unsigned char)255, (unsigned char)255, (unsigned char)255, (unsigned char)255); - //glVertex3f(p.x, p.y, p.z); + glColor4ub((unsigned char)255, (unsigned char)255, (unsigned char)255, (unsigned char)255); + glVertex3f(p.x, p.y, p.z); //if (i==320&&j==160) cerr<<"world point: "<