From 04bc6345764e55ae249a622030f26496a0586541 Mon Sep 17 00:00:00 2001 From: Comment Date: Tue, 18 Jun 2013 22:34:30 +0100 Subject: steaming pile of crap --- 04_playobjects/src/testApp.h | 75 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 11 deletions(-) (limited to '04_playobjects/src/testApp.h') diff --git a/04_playobjects/src/testApp.h b/04_playobjects/src/testApp.h index 0de2207..32e6dad 100644 --- a/04_playobjects/src/testApp.h +++ b/04_playobjects/src/testApp.h @@ -4,6 +4,7 @@ #include "ofxOpenNI.h" #include "ofMain.h" #include "ofxXmlSettings.h" +#include "ofxMayaCam.h" #include "ofxOsc.h" @@ -35,21 +36,22 @@ class syncOniPlayer{ //players[players.size()-1]->start(); //players[players.size()-1]->startPlayer(name); } - void play(ofxOpenNIUser user){ + void play(){ for (int i=0;isetSafeThreading(true); - players[i]->setupFromONI(filenames[i],true); - players[i]->addUserGenerator(); - players[i]->setRegister(true); + players[i]->setupFromONI(filenames[i],false); + //players[i]->addDepthGenerator(); + //players[i]->addImageGenerator(); + //players[i]->setRegister(true); players[i]->setLooped(false); - players[i]->setBaseUserClass(user); + //players[i]->setBaseUserClass(user); players[i]->start(); //players[players.size()-1]->setSpeed(1.0f); if (audio!="") { soundplayer.loadSound(audio); soundplayer.play(); - } + }; } } void update(){ @@ -63,29 +65,81 @@ class syncOniPlayer{ players[i]->setPaused(true); } } + int getCurrentFrame(){ + if (players.size()) return players[0]->getCurrentFrame(); + else return -1; + } void drawWindows(){ for (int i=0;idrawDepth(50, 0,520,390); players[i]->drawImage(600, 0,520,390); } } void drawCloud(){ + /* + int num=0; for (int i=0;igetNumTrackedUsers(); for (int nID = 0; nID < numUsers; nID++){ ofxOpenNIUser & user = players[i]->getTrackedUser(nID); - user.drawMask(); + //user.drawMask(); ofPushMatrix(); - ofTranslate(ofGetWidth()/2, ofGetHeight()/2, -1000); + ofTranslate(0,0,-1000); user.drawPointCloud(); ofPopMatrix(); } + num+=numUsers; ofDisableBlendMode(); ofPopMatrix(); } + return num; + */ + //cerr<<"drawing "<getDepthGenerator().GetDepthMap(); + //uint16_t* depthpixels=depthmap.getPixels(); + int range=2500; + + if (players[i]==NULL) { + cerr<<"more spooky shit....!"; + return; + } + int dmw=players[i]->getWidth(); + + for (int i=0;igetWidth();i+=2) { + + glBegin(GL_LINES); + + for (int j=0;jgetHeight();j+=2) { + + + + ofPoint p= players[i]->projectiveToWorld(ofPoint(i,j,(float)(depthmap[j*dmw+i]))); + //ofPoint p= projectiveToWorld(ofPoint(i,j,(float)depthmap[j*dmw+i])); + + if (p.z == 0 || p.z>range) continue; // gets rid of background -> still a bit weird if userID > 0... //&& isCPBkgnd + //ofColor color = kinect->getColorAt(x,y); //userID); + //if (col) glColor4ub((unsigned char)color.r, (unsigned char)color.g, (unsigned char)color.b, (unsigned char)color.a); + // else + + + 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: "< players; - ofSoundPlayer soundplayer; - ofxOscReceiver receiver; bool drawmovies,drawcloud; int offset; + + ofxMayaCam cam; }; -- cgit v1.2.3