From 4f4662fba0c22c91c17eeea436d566398f8e5779 Mon Sep 17 00:00:00 2001 From: Comment Date: Mon, 17 Jun 2013 00:40:52 +0100 Subject: much done: al lot more to do --- 03_play/config.make | 2 ++ 03_play/src/testApp.cpp | 75 +++++++++++++++++++++++++++++++++++++++++++++++-- 03_play/src/testApp.h | 3 ++ 3 files changed, 77 insertions(+), 3 deletions(-) diff --git a/03_play/config.make b/03_play/config.make index 821a73a..af411a0 100755 --- a/03_play/config.make +++ b/03_play/config.make @@ -19,6 +19,8 @@ USER_CFLAGS = -I $(OF_ROOT)/addons/ofxOpenNI/include/openni -I $(OF_ROOT)/addons USER_LDFLAGS = -lOpenNI +CXX=colorgcc + EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj" 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;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 + + + 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: "<