diff options
| author | Comment <tim@gray.(none)> | 2013-06-20 09:06:40 +0100 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-06-20 09:06:40 +0100 |
| commit | 39bcb5346b1f746399192391b6699e81d0d8ad3a (patch) | |
| tree | 36445cbd0d270f5181fb04eaf875a7b6f3422ff2 /04_playobjects/src | |
| parent | cdd0e0b630bd3a5a8ba15dbce7f5e03221b72f92 (diff) | |
spooky bug fixed, integration nearly right
Diffstat (limited to '04_playobjects/src')
| -rw-r--r-- | 04_playobjects/src/testApp.h | 53 |
1 files changed, 10 insertions, 43 deletions
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;i<players.size();i++) { - - - const XnDepthPixel* depthmap=players[i]->getDepthGenerator().GetDepthMap(); - //uint16_t* depthpixels=depthmap.getPixels(); - int range=2500; - - for (int i=0;i<depthW;i+=2) { - - glBegin(GL_LINES); - - for (int j=0;j<depthH;j+=2) { - - - ofPoint p= players[i]->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 - - - //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: "<<p.x<<","<<p.y<<","<<p.z<<endl; - } - - glEnd(); - } - - } } } void drawCloud(){ int count; - for (int i=0;i<players.size();i++) { + for (int n=0;n<players.size();n++) { - const XnDepthPixel* depthmap=players[i]->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;i<depthW;i+=2) { @@ -136,14 +102,14 @@ class syncOniPlayer{ for (int j=0;j<depthH;j+=2) { - ofPoint p= players[i]->projectiveToWorld(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: "<<p.x<<","<<p.y<<","<<p.z<<endl; } @@ -175,6 +141,7 @@ class syncOniPlayer{ }; + //however creating losts of ofxOpenNI doesn't seem viable //we know we want to play seperate clips //however we know that when we stop and start a player it comes back single threaded |
