summaryrefslogtreecommitdiff
path: root/04_playobjects/src/testApp.h
diff options
context:
space:
mode:
Diffstat (limited to '04_playobjects/src/testApp.h')
-rw-r--r--04_playobjects/src/testApp.h53
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