summaryrefslogtreecommitdiff
path: root/03_play/src
diff options
context:
space:
mode:
Diffstat (limited to '03_play/src')
-rw-r--r--03_play/src/testApp.cpp75
-rw-r--r--03_play/src/testApp.h3
2 files changed, 75 insertions, 3 deletions
diff --git a/03_play/src/testApp.cpp b/03_play/src/testApp.cpp
index 6d10c0d..5553bc8 100644
--- a/03_play/src/testApp.cpp
+++ b/03_play/src/testApp.cpp
@@ -72,17 +72,86 @@ void testApp::draw(){
ofBackground(0, 0, 0);
ofSetColor(255, 255, 255);
+
+
ofPushMatrix();
+ //ofTranslate(0,0,-1500);
+ ofRotate(0,1,0,180);
+
+ //cam.begin();
+
+ ofDrawAxis(100);
+
+ //glEnable(GL_PROGRAM_POINT_SIZE);
+ //glEnable(GL_POINT_SMOOTH);
+ //glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
+
+ //glPointSize(12.0f);
for (int deviceID = 0; deviceID < numDevices; deviceID++){
- ofTranslate(0, deviceID * 400);
+ //ofTranslate(0, deviceID * 400);
//openNIPlayers[deviceID].drawDebug();
- openNIPlayers[deviceID].drawDepth(50, 0,520,390);
- openNIPlayers[deviceID].drawImage(600, 0,520,390);
+ //openNIPlayers[deviceID].drawDepth(50, 0,520,390);
+ //openNIPlayers[deviceID].drawImage(600, 0,520,390);
+
+ //construct points
+ //glBegin(GL_POINTS);
+ //how to find buffer size?
+ /*
+ XnStatus xn::DepthGenerator::ConvertProjectiveToRealWorld ( XnUInt32 nCount,
+ const XnPoint3D aProjective[],
+ XnPoint3D aRealWorld[]
+ )
+ */
+
+ int count;
+ const XnDepthPixel* depthmap=openNIPlayers[deviceID].getDepthGenerator().GetDepthMap();
+ int range=2000;
+
+ int dmw=openNIPlayers[deviceID].getWidth();
+
+ for (int i=0;i<openNIPlayers[deviceID].getWidth();i+=2) {
+
+ glBegin(GL_LINES);
+
+ for (int j=0;j<openNIPlayers[deviceID].getHeight();j+=2) {
+
+
+
+ ofPoint p= openNIPlayers[deviceID].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: "<<p.x<<","<<p.y<<","<<p.z<<endl;
+ }
+
+ glEnd();
+ }
}
+ //export for fast/ switchable playback
+ //figure out how to line up (could be one off)
+ //export frame and find matching coords
+ //manually find positions
+ //calculate offset
+ //audio sync
+ //gui
+ //audio analysis
+ //sfx for point cloud
+
+ //cam.end();
+
ofPopMatrix();
+ glDisable(GL_PROGRAM_POINT_SIZE);
+
ofSetColor(255, 255, 255);
string msg = "MILLIS: " + ofToString(ofGetElapsedTimeMillis());
msg += "\nFPS: " + ofToString(ofGetFrameRate());
diff --git a/03_play/src/testApp.h b/03_play/src/testApp.h
index c162d2b..1b3a0c1 100644
--- a/03_play/src/testApp.h
+++ b/03_play/src/testApp.h
@@ -4,6 +4,7 @@
#include "ofxOpenNI.h"
#include "ofMain.h"
#include "ofxXmlSettings.h"
+#include "ofxMayaCam.h"
#define MAX_DEVICES 2
@@ -44,6 +45,8 @@ public:
ofSoundPlayer soundplayer;
float offset;
+
+ ofxMayaCam cam;
};