diff options
| author | Tim Redfern <tim@gray.(none)> | 2012-11-11 15:59:00 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@gray.(none)> | 2012-11-11 15:59:00 +0000 |
| commit | 4656e88bb1626fcc0e7941883ac475884e4c99b0 (patch) | |
| tree | cadd1759913be53a2ce4adb94d494918f7af2541 | |
| parent | d06fe4264b760e4be5880456cfd50f817dbeb1ea (diff) | |
working single threaded
| -rwxr-xr-x | liveengine/bin/data/settings.xml | 13 | ||||
| -rwxr-xr-x | liveengine/liveengine.layout | 10 | ||||
| -rwxr-xr-x | liveengine/src/testApp.cpp | 9 | ||||
| -rwxr-xr-x | liveengine/src/viewport.cpp | 22 | ||||
| -rwxr-xr-x | tshirtmapping/src/testApp.cpp | 33 | ||||
| -rwxr-xr-x | tshirtmapping/src/testApp.h | 5 | ||||
| -rwxr-xr-x | 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 @@ -<?xml version="1.0" encoding="UTF-8" ?>
-<liveEngine port="1" channel="0">
- <viewport mapped="1" w="1024" h="768" x="0" y="0" rot="0" ox="-512" oy="-384">
- <settings fov="17.5" roll="0" targX="0" targY="0" targZ="0" lat="0" lng="0" dolly="600" />
- </viewport>
-</liveEngine>
- +<?xml version="1.0" encoding="UTF-8" ?> +<liveEngine port="1" channel="0"> + <viewport mapped="1" w="1024" h="768" x="0" y="0" rot="0" ox="-512" oy="-384"> + <settings fov="17.500000" roll="0.000000" targX="-247.713226" targY="212.727859" targZ="0.000000" lat="0.000000" lng="180.000000" dolly="600.000000" /> + </viewport> +</liveEngine> 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 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <CodeBlocks_layout_file> <ActiveTarget name="Debug" /> - <File name="bin/data/settings.xml" open="1" top="1" tabpos="5"> - <Cursor position="234" topLine="0" /> + <File name="bin/data/settings.xml" open="1" top="0" tabpos="5"> + <Cursor position="236" topLine="0" /> </File> <File name="config.make" open="0" top="0" tabpos="2"> <Cursor position="0" topLine="0" /> @@ -11,13 +11,13 @@ <Cursor position="290" topLine="0" /> </File> <File name="src/testApp.cpp" open="1" top="0" tabpos="2"> - <Cursor position="13919" topLine="138" /> + <Cursor position="4343" topLine="98" /> </File> <File name="src/testApp.h" open="1" top="0" tabpos="1"> <Cursor position="3971" topLine="162" /> </File> - <File name="src/viewport.cpp" open="1" top="0" tabpos="4"> - <Cursor position="8472" topLine="272" /> + <File name="src/viewport.cpp" open="1" top="1" tabpos="4"> + <Cursor position="4871" topLine="271" /> </File> <File name="src/viewport.h" open="1" top="0" tabpos="3"> <Cursor position="283" topLine="0" /> 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<string,string>&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;i<rUser->getNumberOfTrackedUsers();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 @@ <Cursor position="185" topLine="0" /> </File> <File name="src/testApp.cpp" open="1" top="1" tabpos="2"> - <Cursor position="2252" topLine="84" /> + <Cursor position="1607" topLine="56" /> </File> <File name="src/testApp.h" open="1" top="0" tabpos="1"> - <Cursor position="987" topLine="7" /> + <Cursor position="991" topLine="9" /> </File> </CodeBlocks_layout_file> |
