From 4656e88bb1626fcc0e7941883ac475884e4c99b0 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sun, 11 Nov 2012 15:59:00 +0000 Subject: working single threaded --- liveengine/bin/data/settings.xml | 13 ++++++------- liveengine/liveengine.layout | 10 +++++----- liveengine/src/testApp.cpp | 9 +++++++-- liveengine/src/viewport.cpp | 22 +++++++++++----------- tshirtmapping/src/testApp.cpp | 33 +-------------------------------- tshirtmapping/src/testApp.h | 5 ++--- tshirtmapping/tshirtmapping.layout | 4 ++-- 7 files changed, 34 insertions(+), 62 deletions(-) diff --git a/liveengine/bin/data/settings.xml b/liveengine/bin/data/settings.xml index abe3343..6c31de3 100755 --- a/liveengine/bin/data/settings.xml +++ b/liveengine/bin/data/settings.xml @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/liveengine/liveengine.layout b/liveengine/liveengine.layout index 77840d6..2831ed4 100755 --- a/liveengine/liveengine.layout +++ b/liveengine/liveengine.layout @@ -1,8 +1,8 @@ - - + + @@ -11,13 +11,13 @@ - + - - + + diff --git a/liveengine/src/testApp.cpp b/liveengine/src/testApp.cpp index fb531a5..a2a242f 100755 --- a/liveengine/src/testApp.cpp +++ b/liveengine/src/testApp.cpp @@ -93,7 +93,7 @@ void testApp::setup(){ isTracking = false; isFiltering = false; isMasking = true; - isCloud = false; + isCloud = true; nearThreshold = 500; farThreshold = 1000; @@ -101,6 +101,7 @@ void testApp::setup(){ filterFactor = 10.0f; recordContext.setup(); + recordContext.setMirror(true); recordDepth.setup(&recordContext); recordImage.setup(&recordContext); recordUser.setup(&recordContext); @@ -127,7 +128,11 @@ void testApp::setup(){ } } else printf("no viewports!\n"); - } + + XML.popTag(); + + } + } activeView=-1; diff --git a/liveengine/src/viewport.cpp b/liveengine/src/viewport.cpp index 5a5a5e2..e5e5ef3 100755 --- a/liveengine/src/viewport.cpp +++ b/liveengine/src/viewport.cpp @@ -179,9 +179,9 @@ void viewport::setcam(map&settings){ vars=new keyVar[9]; vars[0].set('w','s',ofToFloat(settings["fov"]),0.2,1.0,3.0); - vars[1].set('g','d',ofToFloat(settings["targX"]),1,1.0,3.0); - vars[2].set('r','v',ofToFloat(settings["targY"]),1,1.0,3.0); - vars[3].set('t','c',ofToFloat(settings["targZ"]),1,1.0,3.0); + vars[1].set('g','d',ofToFloat(settings["targX"]),10,1.0,3.0); + vars[2].set('r','v',ofToFloat(settings["targY"]),10,1.0,3.0); + vars[3].set('t','c',ofToFloat(settings["targZ"]),10,1.0,3.0); vars[4].set('u','n',ofToFloat(settings["lat"]),1,1.0,3.0); vars[5].set('j','h',ofToFloat(settings["lng"]),1,1.0,3.0); vars[6].set(',','m',ofToFloat(settings["roll"]),1,1.0,3.0); @@ -282,17 +282,18 @@ void viewport::mapdraw(float a,unsigned char* controllers,int xshift,int yshift, //rb1.draw(0,0); //map onto kinect skeleton - bindTexture(rb1); + camera.begin(); if (drawCloud) { - int step = 1; - for(int y = 0; y < h; y += step) { - for(int x = 0; x < w; x += step) { + int step = 1; + glBegin(GL_POINTS); + for(int y = 0; y < 480; y += step) { + for(int x = 0; x < 640; x += step) { ofPoint pos = rUser->getWorldCoordinateAt(x, y, 0); //userID); - if (pos.z == 0 ) continue; // gets rid of background -> still a bit weird if userID > 0... //&& isCPBkgnd + //if (pos.z == 0 ) continue; // gets rid of background -> still a bit weird if userID > 0... //&& isCPBkgnd ofColor color = rUser->getWorldColorAt(x,y, 0); //userID); glColor4ub((unsigned char)color.r, (unsigned char)color.g, (unsigned char)color.b, (unsigned char)color.a); glVertex3f(pos.x, pos.y, pos.z); @@ -301,10 +302,9 @@ void viewport::mapdraw(float a,unsigned char* controllers,int xshift,int yshift, glEnd(); glColor3f(1.0f, 1.0f, 1.0f); } + + bindTexture(rb1); - - glPushMatrix(); - glScalef(ofGetWidth()/640.0f,ofGetHeight()/480.0f, 1); for (int i=0;igetNumberOfTrackedUsers();i++){ ofxTrackedUser* u=(rUser->getTrackedUser(i+1)); diff --git a/tshirtmapping/src/testApp.cpp b/tshirtmapping/src/testApp.cpp index dd00b8f..9b7124a 100755 --- a/tshirtmapping/src/testApp.cpp +++ b/tshirtmapping/src/testApp.cpp @@ -65,6 +65,7 @@ void testApp::setup(){ filterFactor = 10.0f; recordContext.setup(); + recordContext.setMirror(true); recordDepth.setup(&recordContext); recordImage.setup(&recordContext); recordUser.setup(&recordContext); @@ -90,38 +91,6 @@ void testApp::update(){ recordUser.update(); } -void testApp::setCam(){ - - ofNode c=ofNode(); - ofNode t=ofNode(); - t.setParent(c); - t.setPosition(vars[1].getVal(),vars[2].getVal(),vars[3].getVal()); - //make target controls relative to rotation - c.rotate(vars[5].getVal(), ofVec3f(0, 1, 0)); - - target.setPosition(t.getGlobalPosition()); - //camera.orbit(vars[5].getVal(), vars[4].getVal(), vars[7].getVal(), target); - camera.setFov(vars[0].getVal()); - if (vertigo) { - //distance=width/(2 tan (fov *0.5) - //multiply distance by ratio of tans of fov before and after - vars[7].setVal((tan((vars[0].readVal()-vars[0].inc)*PI*0.0027777)*vars[7].readVal())/tan(vars[0].readVal()*PI*0.0027777)); - } - - - - ofVec3f p(0, 0, vars[7].getVal()); - //p.rotate(ofClamp(vars[2].getVal(), -89, 89), ofVec3f(1, 0, 0)); - p.rotate(vars[4].getVal(), ofVec3f(1, 0, 0)); - p.rotate(vars[5].getVal(), ofVec3f(0, 1, 0)); - p += target.getPosition(); - camera.setPosition(p); - - camera.lookAt(target,ofVec3f(0,1,0).rotate(vars[6].getVal(),ofVec3f(0,0,1)).rotate(vars[5].getVal(),ofVec3f(0,1,0))); - light.setPosition(camera.getGlobalPosition()); - -} - //-------------------------------------------------------------- void testApp::draw(){ ofSetColor(255, 255, 255); diff --git a/tshirtmapping/src/testApp.h b/tshirtmapping/src/testApp.h index 9af276a..1b68f8a 100755 --- a/tshirtmapping/src/testApp.h +++ b/tshirtmapping/src/testApp.h @@ -41,8 +41,7 @@ class testApp : public ofBaseApp{ bool draw3D; float camRotationY; - - ofCamera camera; - ofNode target; + + }; diff --git a/tshirtmapping/tshirtmapping.layout b/tshirtmapping/tshirtmapping.layout index fa3b053..e6802b6 100755 --- a/tshirtmapping/tshirtmapping.layout +++ b/tshirtmapping/tshirtmapping.layout @@ -14,9 +14,9 @@ - + - + -- cgit v1.2.3