From 021e5cdd35bd0a84295e8083c5b5dd9b19b03a79 Mon Sep 17 00:00:00 2001 From: Comment Date: Mon, 17 Jun 2013 09:30:14 +0100 Subject: difficulties with playback --- 03_play/src/testApp.cpp | 138 ++++++++++++++++++++++++++++++------------------ 1 file changed, 86 insertions(+), 52 deletions(-) (limited to '03_play/src/testApp.cpp') diff --git a/03_play/src/testApp.cpp b/03_play/src/testApp.cpp index 5553bc8..56896cc 100644 --- a/03_play/src/testApp.cpp +++ b/03_play/src/testApp.cpp @@ -41,6 +41,8 @@ void testApp::setup() { //ofSetFrameRate(25.0f); offset=0.0f; + drawmovies=false;drawcloud=true; + frame=0; } void testApp::startPlayers(){ @@ -49,6 +51,9 @@ void testApp::startPlayers(){ //openNIPlayers[deviceID].setup(false); //openNIPlayers[deviceID].start(); openNIPlayers[deviceID].startPlayer(ofToDataPath(recs[playing].data[deviceID])); + //openNIPlayers[deviceID].setSpeed(0.0000001f); + //openNIPlayers[deviceID].setPaused(true); + soundplayer.stop(); @@ -63,24 +68,17 @@ void testApp::startPlayers(){ //-------------------------------------------------------------- void testApp::update(){ for (int deviceID = 0; deviceID < numDevices; deviceID++){ + openNIPlayers[deviceID].setFrame(frame); openNIPlayers[deviceID].update(); } } //-------------------------------------------------------------- void testApp::draw(){ - ofBackground(0, 0, 0); + ofBackground(50, 50, 50); 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); @@ -88,69 +86,92 @@ void testApp::draw(){ //glPointSize(12.0f); + + for (int deviceID = 0; deviceID < numDevices; deviceID++){ - //ofTranslate(0, deviceID * 400); - //openNIPlayers[deviceID].drawDebug(); - //openNIPlayers[deviceID].drawDepth(50, 0,520,390); - //openNIPlayers[deviceID].drawImage(600, 0,520,390); + + if (drawmovies) { + ofTranslate(0, deviceID * 400); + //openNIPlayers[deviceID].drawDebug(); + 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[] - ) - */ + /* + XnStatus xn::DepthGenerator::ConvertProjectiveToRealWorld ( XnUInt32 nCount, + const XnPoint3D aProjective[], + XnPoint3D aRealWorld[] + ) + */ - int count; - const XnDepthPixel* depthmap=openNIPlayers[deviceID].getDepthGenerator().GetDepthMap(); - int range=2000; + if (drawcloud) { - int dmw=openNIPlayers[deviceID].getWidth(); + cam.begin(); - for (int i=0;irange) 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 + glBegin(GL_LINES); + for (int j=0;jrange) 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 + - //cam.end(); + 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: "<