diff options
Diffstat (limited to 'TRRSS_01_rec')
| -rwxr-xr-x | TRRSS_01_rec/Makefile | 2 | ||||
| -rwxr-xr-x | TRRSS_01_rec/TRRSS_01_rec.cbp | 123 | ||||
| -rw-r--r-- | TRRSS_01_rec/TRRSS_01_rec.layout | 25 | ||||
| -rwxr-xr-x | TRRSS_01_rec/TRRSS_01_rec.workspace | 9 | ||||
| -rw-r--r-- | TRRSS_01_rec/addons.make | 5 | ||||
| -rw-r--r-- | TRRSS_01_rec/bin/data/verdana.ttf | bin | 171792 -> 0 bytes | |||
| -rwxr-xr-x | TRRSS_01_rec/config.make | 56 | ||||
| -rwxr-xr-x | TRRSS_01_rec/src/main.cpp | 19 | ||||
| -rwxr-xr-x | TRRSS_01_rec/src/testApp.cpp | 407 | ||||
| -rwxr-xr-x | TRRSS_01_rec/src/testApp.h | 106 |
10 files changed, 0 insertions, 752 deletions
diff --git a/TRRSS_01_rec/Makefile b/TRRSS_01_rec/Makefile deleted file mode 100755 index 2d83a77..0000000 --- a/TRRSS_01_rec/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -include config.make -include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/Makefile.examples diff --git a/TRRSS_01_rec/TRRSS_01_rec.cbp b/TRRSS_01_rec/TRRSS_01_rec.cbp deleted file mode 100755 index 9fd8544..0000000 --- a/TRRSS_01_rec/TRRSS_01_rec.cbp +++ /dev/null @@ -1,123 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> -<CodeBlocks_project_file> - <FileVersion major="1" minor="6" /> - <Project> - <Option title="TRRSS_01_rec" /> - <Option makefile_is_custom="1" /> - <Option pch_mode="2" /> - <Option compiler="gcc" /> - <Option virtualFolders="addons/;src/;build config/;addons/ofxOpenNI/src/;" /> - <Build> - <Target title="Debug"> - <Option output="bin/$(PROJECT_NAME)_debug" prefix_auto="1" extension_auto="1" /> - <Option working_dir="bin" /> - <Option object_output="obj/Debug/" /> - <Option external_deps="../../openFrameworks/libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a;" /> - <Option type="1" /> - <Option compiler="gcc" /> - <Option projectLinkerOptionsRelation="2" /> - </Target> - <Target title="Release"> - <Option output="bin/$(PROJECT_NAME)" prefix_auto="1" extension_auto="1" /> - <Option working_dir="bin" /> - <Option object_output="obj/Release/" /> - <Option external_deps="../../openFrameworks/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a;" /> - <Option type="1" /> - <Option compiler="gcc" /> - <Option projectLinkerOptionsRelation="2" /> - </Target> - </Build> - <Unit filename="addons.make"> - <Option virtualFolder="build config/" /> - </Unit> - <Unit filename="config.make"> - <Option virtualFolder="build config" /> - </Unit> - <Unit filename="src/main.cpp"> - <Option virtualFolder="src/" /> - </Unit> - <Unit filename="src/testApp.cpp"> - <Option virtualFolder="src/" /> - </Unit> - <Unit filename="src/testApp.h"> - <Option virtualFolder="src/" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxDepthGenerator.cpp"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxDepthGenerator.h"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxGestureGenerator.cpp"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxGestureGenerator.h"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxHandGenerator.cpp"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxHandGenerator.h"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxHardwareDriver.cpp"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxHardwareDriver.h"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxIRGenerator.cpp"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxIRGenerator.h"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxImageGenerator.cpp"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxImageGenerator.h"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxOpenNI.h"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxOpenNIContext.cpp"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxOpenNIContext.h"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxOpenNIMacros.h"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxOpenNIRecorder.cpp"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxOpenNIRecorder.h"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxTrackedHand.cpp"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxTrackedHand.h"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxTrackedUser.cpp"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxTrackedUser.h"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxUserGenerator.cpp"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Unit filename="../../openFrameworks/addons/ofxOpenNI/src/ofxUserGenerator.h"> - <Option virtualFolder="addons/ofxOpenNI/src" /> - </Unit> - <Extensions> - <code_completion /> - <envvars /> - <debugger /> - </Extensions> - </Project> -</CodeBlocks_project_file> diff --git a/TRRSS_01_rec/TRRSS_01_rec.layout b/TRRSS_01_rec/TRRSS_01_rec.layout deleted file mode 100644 index 748c550..0000000 --- a/TRRSS_01_rec/TRRSS_01_rec.layout +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> -<CodeBlocks_layout_file> - <ActiveTarget name="Debug" /> - <File name="addons.make" open="1" top="0" tabpos="1"> - <Cursor position="53" topLine="0" /> - </File> - <File name="config.make" open="0" top="0" tabpos="0"> - <Cursor position="601" topLine="0" /> - </File> - <File name="src/main.cpp" open="0" top="0" tabpos="0"> - <Cursor position="187" topLine="0" /> - </File> - <File name="src/testApp.cpp" open="1" top="1" tabpos="2"> - <Cursor position="2624" topLine="24" /> - </File> - <File name="src/testApp.h" open="0" top="0" tabpos="0"> - <Cursor position="731" topLine="15" /> - </File> - <File name="../../openFrameworks/addons/ofxOpenNI/src/ofxImageGenerator.h" open="1" top="0" tabpos="5"> - <Cursor position="1643" topLine="21" /> - </File> - <File name="../../openFrameworks/addons/ofxOpenNI/src/ofxOpenNIContext.h" open="0" top="0" tabpos="0"> - <Cursor position="1305" topLine="16" /> - </File> -</CodeBlocks_layout_file> diff --git a/TRRSS_01_rec/TRRSS_01_rec.workspace b/TRRSS_01_rec/TRRSS_01_rec.workspace deleted file mode 100755 index d8488cd..0000000 --- a/TRRSS_01_rec/TRRSS_01_rec.workspace +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> -<CodeBlocks_workspace_file> - <Workspace title="TRRSS_01_rec"> - <Project filename="TRRSS_01_rec.cbp" active="1"> - <Depends filename="../../openFrameworks/libs/openFrameworksCompiled/project/linux64/libopenFrameworks.cbp" /> - </Project> - <Project filename="../../openFrameworks/libs/openFrameworksCompiled/project/linux64/libopenFrameworks.cbp" /> - </Workspace> -</CodeBlocks_workspace_file> diff --git a/TRRSS_01_rec/addons.make b/TRRSS_01_rec/addons.make deleted file mode 100644 index 0b4df47..0000000 --- a/TRRSS_01_rec/addons.make +++ /dev/null @@ -1,5 +0,0 @@ -ofxOpenNI -ofxFenster -ofxGui -ofxXmlSettings -ofxMayaCam diff --git a/TRRSS_01_rec/bin/data/verdana.ttf b/TRRSS_01_rec/bin/data/verdana.ttf Binary files differdeleted file mode 100644 index 8f25a64..0000000 --- a/TRRSS_01_rec/bin/data/verdana.ttf +++ /dev/null diff --git a/TRRSS_01_rec/config.make b/TRRSS_01_rec/config.make deleted file mode 100755 index 821a73a..0000000 --- a/TRRSS_01_rec/config.make +++ /dev/null @@ -1,56 +0,0 @@ -# add custom variables to this file - -# OF_ROOT allows to move projects outside apps/* just set this variable to the -# absoulte path to the OF root folder - -OF_ROOT = ../../openFrameworks - - -# USER_CFLAGS allows to pass custom flags to the compiler -# for example search paths like: -# USER_CFLAGS = -I src/objects - -USER_CFLAGS = -I $(OF_ROOT)/addons/ofxOpenNI/include/openni -I $(OF_ROOT)/addons/ofxOpenNI/include/nite -I $(OF_ROOT)/addons/ofxOpenNI/src - - -# USER_LDFLAGS allows to pass custom flags to the linker -# for example libraries like: -# USER_LDFLAGS = libs/libawesomelib.a - -USER_LDFLAGS = -lOpenNI - - -EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj" - -# change this to add different compiler optimizations to your project - -USER_COMPILER_OPTIMIZATION = -march=native -mtune=native -Os - - -# android specific, in case you want to use different optimizations -USER_LIBS_ARM = -USER_LIBS_ARM7 = -USER_LIBS_NEON = - -# android optimizations - -ANDROID_COMPILER_OPTIMIZATION = -Os - -NDK_PLATFORM = android-8 - -# uncomment this for custom application name (if the folder name is different than the application name) -#APPNAME = folderName - -# uncomment this for custom package name, must be the same as the java package that contains OFActivity -#PKGNAME = cc.openframeworks.$(APPNAME) - - - - - -# linux arm flags - -LINUX_ARM7_COMPILER_OPTIMIZATIONS = -march=armv7-a -mtune=cortex-a8 -finline-functions -funroll-all-loops -O3 -funsafe-math-optimizations -mfpu=neon -ftree-vectorize -mfloat-abi=hard -mfpu=vfp - - - diff --git a/TRRSS_01_rec/src/main.cpp b/TRRSS_01_rec/src/main.cpp deleted file mode 100755 index de63c21..0000000 --- a/TRRSS_01_rec/src/main.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "ofMain.h" -#include "testApp.h" -#include "ofAppGlutWindow.h" - -//======================================================================== -int main( ){ - - ofAppGlutWindow window; - ofSetupOpenGL(ofxFensterManager::get(),800,600, OF_WINDOW); //2048,768 - //ofSetupOpenGL(&window, 1024,768, OF_WINDOW); // <-------- setup the GL context - //ofSetupOpenGL(&window, 1024,768, OF_WINDOW); - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - //ofRunApp( new testApp()); - ofRunFensterApp( new testApp()); - -} diff --git a/TRRSS_01_rec/src/testApp.cpp b/TRRSS_01_rec/src/testApp.cpp deleted file mode 100755 index 82affcb..0000000 --- a/TRRSS_01_rec/src/testApp.cpp +++ /dev/null @@ -1,407 +0,0 @@ -#include "testApp.h" -//texture binding with normalised coords -void bindTexture(ofBaseHasTexture &t) { - ofTexture &tex = t.getTextureReference(); - tex.bind(); - - glMatrixMode(GL_TEXTURE); - glPushMatrix(); - glLoadIdentity(); - - ofTextureData texData = tex.getTextureData(); - if(texData.textureTarget == GL_TEXTURE_RECTANGLE_ARB) { - glScalef(tex.getWidth(), tex.getHeight(), 1.0f); - } else { - glScalef(tex.getWidth() / texData.tex_w, tex.getHeight() / texData.tex_h, 1.0f); - } - - glMatrixMode(GL_MODELVIEW); -} -void unbindTexture(ofBaseHasTexture &t) { - t.getTextureReference().unbind(); - - glMatrixMode(GL_TEXTURE); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); -} -void bindTex(ofTexture &tex) { - tex.bind(); - - glMatrixMode(GL_TEXTURE); - glPushMatrix(); - glLoadIdentity(); - - ofTextureData texData = tex.getTextureData(); - if(texData.textureTarget == GL_TEXTURE_RECTANGLE_ARB) { - glScalef(tex.getWidth(), tex.getHeight(), 1.0f); - } else { - glScalef(tex.getWidth() / texData.tex_w, tex.getHeight() / texData.tex_h, 1.0f); - } - - glMatrixMode(GL_MODELVIEW); -} -void unbindTex(ofTexture &tex) { - tex.unbind(); - - glMatrixMode(GL_TEXTURE); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); -} -//-------------------------------------------------------------- -void testApp::setup(){ - isLive = true; - isRecording = false; - -#ifdef NEWAPI - openNIDevice.setup(false);//FromXML("openni/config/ofxopenni_config.xml"); - openNIDevice.setLogLevel(OF_LOG_VERBOSE); - openNIDevice.addDepthGenerator(); - openNIDevice.addImageGenerator(); // comment this out - openNIDevice.addUserGenerator(); - openNIDevice.setRegister(true); - openNIDevice.setMirror(true); - openNIDevice.start(); - - openNIDevice.setUseDepthRawPixels(true); - - //openNIDevice.setSafeThreading(true); ?slower and still crashes? - - openNIDevice.setMaxNumUsers(1); - ofAddListener(openNIDevice.userEvent, this, &testApp::userEvent); - - ofxOpenNIUser user; - user.setUseMaskTexture(true); - user.setUsePointCloud(true); - user.setPointCloudDrawSize(1); // this is the size of the glPoint that will be drawn for the point cloud - user.setPointCloudResolution(1); // this is the step size between points for the cloud -> eg., this sets it to every second point - openNIDevice.setBaseUserClass(user); - - -#else - /* - recordContext.setup(); - recordDepth.setup(&recordContext); - recordImage.setup(&recordContext); - recordUser.setup(&recordContext); - recordUser.setUseCloudPoints(true); - recordUser.setSmoothing(10.0f); - recordContext.toggleRegisterViewport(); - */ -#endif - - setupRecording(); - whichUser=&recordUser; - whichImage=&recordImage; - - guiWin=new guiWindow(); - ofxFenster* win=ofxFensterManager::get()->createFenster(0, 0, 200, 400, OF_WINDOW); - win->setWindowTitle("config"); - win->addListener(guiWin); - guiWin->setup(); -} - -void testApp::setupRecording(string _filename) { - - bool isCloud=true; - -#if defined (TARGET_OSX) //|| defined(TARGET_LINUX) // only working on Mac/Linux at the moment (but on Linux you need to run as sudo...) - hardware.setup(); // libusb direct control of motor, LED and accelerometers - hardware.setLedOption(LED_OFF); // turn off the led just for yacks (or for live installation/performances ;-) -#endif - - recordContext.setup(); // all nodes created by code -> NOT using the xml config file at all - //recordContext.setupUsingXMLFile(); - recordDepth.setup(&recordContext); - recordImage.setup(&recordContext); - - recordUser.setup(&recordContext); - //recordUser.setSmoothing(filterFactor); // built in openni skeleton smoothing... - //recordUser.setUseMaskPixels(isMasking); - recordUser.setUseCloudPoints(isCloud); - recordUser.setMaxNumberOfUsers(2); // use this to set dynamic max number of users (NB: that a hard upper limit is defined by MAX_NUMBER_USERS in ofxUserGenerator) - - recordContext.toggleRegisterViewport(); - recordContext.toggleMirror(); - - oniRecorder.setup(&recordContext, ONI_STREAMING); - //oniRecorder.setup(&recordContext, ONI_CYCLIC, 60); - //read the warning in ofxOpenNIRecorder about memory usage with ONI_CYCLIC recording!!! - -} - -void testApp::setupPlayback(string _filename) { - - bool isCloud=true; - - playContext.shutdown(); - playContext.setupUsingRecording(ofToDataPath(_filename)); - playDepth.setup(&playContext); - playImage.setup(&playContext); - - playUser.setup(&playContext); - //playUser.setSmoothing(filterFactor); // built in openni skeleton smoothing... - //playUser.setUseMaskPixels(isMasking); - playUser.setUseCloudPoints(isCloud); - - playContext.toggleRegisterViewport(); - playContext.toggleMirror(); - -} - -//-------------------------------------------------------------- -void testApp::update(){ - if (isLive) { -#ifdef NEWAPI - openNIDevice.update(); -#else - recordContext.update(); - recordDepth.update(); - recordImage.update(); - recordUser.update(); -#endif - } - else { - - playContext.update(); - playDepth.update(); - playImage.update(); - playUser.update(); - } - if (isRecording) oniRecorder.update(); -} - -//-------------------------------------------------------------- -void testApp::draw(){ -#ifdef NEWAPI - ofSetColor(255, 255, 255); - - - - //openNIDevice.drawDebug(); // draws all generators - //openNIDevice.drawDepth(0, 0); - - if (guiWin->drawPoints) { - -/* - glEnable( GL_POINT_SMOOTH ); - glEnable( GL_BLEND ); - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - glPointSize( guiWin->pointSize ); - - glBegin(GL_POINTS); - glColor3f( 1.0f, 1.0f, 1.0f ); - - - //uint16_t *depth=openNIDevice.getDepthRawPixels().getPixels(); - ofPoint p; - for (int i=0;i<640;i+=guiWin->drawStep){ - for (int j=0;j<480;j+=guiWin->drawStep){ - p=openNIDevice.cameraToWorld(ofVec2f(i,j)); - glVertex3f(p.x,p.y,p.z); - } - } -*/ - - - ofPushMatrix(); - ofEnableBlendMode(OF_BLENDMODE_ALPHA); - int numUsers = openNIDevice.getNumTrackedUsers(); - for (int nID = 0; nID < numUsers; nID++){ - ofxOpenNIUser & user = openNIDevice.getTrackedUser(nID); - user.drawMask(); - ofPushMatrix(); - ofTranslate((1024/2)-(640/2),(768/2)-(480/2),-500); - user.drawPointCloud(); - ofPopMatrix(); - - } - ofDisableBlendMode(); - ofPopMatrix(); - - - } - else { - openNIDevice.drawImage(0, 0,ofGetWidth(),ofGetHeight()); - } -#else - - //cam.begin(); - //bind texture recordImage - //get point data from recordDepth - //draw textured polys and allow manipulation - float cloudWidth=ofGetWidth(); - float cloudHeight=ofGetHeight(); - - ofPushMatrix(); - ofTranslate((ofGetWidth()/2)-(640/2),(ofGetHeight()/2)-(480/2),800); - ofRotate(0.1,1,0.05,30); - //ofRotate(0,0,1,180); - - int step = 1; - - if (guiWin->drawPoints) { - // http://stackoverflow.com/questions/1513811/getting-smooth-big-points-in-opengl - glEnable( GL_POINT_SMOOTH ); - glEnable( GL_BLEND ); - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - glPointSize( guiWin->pointSize ); - - glBegin(GL_POINTS); - glColor3f( 1.0f, 1.0f, 1.0f ); - - float spread=guiWin->distMax-guiWin->distMin; - - for(int y = step; y < 480; y += guiWin->drawStep) { - - for(int x = step; x < 640; x += guiWin->drawStep) { - ofPoint pos4 = whichUser->getWorldCoordinateAt(x, y, 0); //userID); - - if (guiWin->distMin<pos4.z&&pos4.z<guiWin->distMax) { - float l=(pos4.z-guiWin->distMin)/spread; - glColor3f( l, l, l ); - - glVertex3f(pos4.x, pos4.y,-pos4.z); - } - } - - } - glEnd(); - } - else { - bindTex(whichImage->getTexture()); - for(int y = step; y < 480; y += guiWin->drawStep) { - glBegin(GL_QUADS); - for(int x = step; x < 640; x += guiWin->drawStep) { - ofPoint pos1 = whichUser->getWorldCoordinateAt(x-step, y-step, 0); //userID); - ofPoint pos2 = whichUser->getWorldCoordinateAt(x, y-step, 0); //userID); - ofPoint pos3 = whichUser->getWorldCoordinateAt(x-step, y, 0); //userID); - ofPoint pos4 = whichUser->getWorldCoordinateAt(x, y, 0); //userID); - - if ((guiWin->distMin<pos1.z&&pos1.z<guiWin->distMax)&& - (guiWin->distMin<pos2.z&&pos2.z<guiWin->distMax)&& - (guiWin->distMin<pos3.z&&pos3.z<guiWin->distMax)&& - (guiWin->distMin<pos4.z&&pos4.z<guiWin->distMax)) { - - glTexCoord2f(((float)x-step)/640.0f,((float)y-step)/480.0f); - glVertex3f(pos1.x, pos1.y,-pos1.z); - glTexCoord2f(((float)x)/640.0f,((float)y-step)/480.0f); - glVertex3f(pos2.x, pos2.y,-pos2.z); - glTexCoord2f(((float)x)/640.0f,((float)y)/480.0f); - glVertex3f(pos4.x, pos4.y,-pos4.z); - glTexCoord2f(((float)x-step)/640.0f,((float)y)/480.0f); - glVertex3f(pos3.x, pos3.y,-pos3.z); - } - } - glEnd(); - } - - unbindTex(whichImage->getTexture()); - } - ofPopMatrix(); - - - - //recordImage.draw(0, 0, ofGetWidth(),ofGetHeight()); - - //cam.end(); -#endif - -} -#ifdef NEWAPI -void testApp::userEvent(ofxOpenNIUserEvent & event){ - ofLogNotice() << getUserStatusAsString(event.userStatus) << "for user" << event.id << "from device" << event.deviceID; -} -#endif -void testApp::exit(){ -#ifdef NEWAPI - openNIDevice.stop(); -#endif -} - -string testApp::generateFileName() { - - string _root = "kinectRecord"; - - string _timestamp = ofToString(ofGetDay()) + - ofToString(ofGetMonth()) + - ofToString(ofGetYear()) + - ofToString(ofGetHours()) + - ofToString(ofGetMinutes()) + - ofToString(ofGetSeconds()); - - string _filename = (_root + _timestamp + ".oni"); - - return _filename; - -} - -//-------------------------------------------------------------- -void testApp::keyPressed(int key){ - switch (key) { - case 's': - case 'S': - if (isRecording) { - oniRecorder.stopRecord(); - isRecording = false; - break; - } else { - oniRecorder.startRecord(generateFileName()); - isRecording = true; - break; - } - break; - case 'p': - case 'P': - if (oniRecorder.getCurrentFileName() != "" && !isRecording && isLive) { - setupPlayback(oniRecorder.getCurrentFileName()); - isLive = false; - whichUser=&playUser; - whichImage=&playImage; - } else { - isLive = true; - whichUser=&recordUser; - whichImage=&recordImage; - } - break; - } -} - -//-------------------------------------------------------------- -void testApp::keyReleased(int key){ - -} - -//-------------------------------------------------------------- -void testApp::mouseMoved(int x, int y ){ - -} - -//-------------------------------------------------------------- -void testApp::mouseDragged(int x, int y, int button){ - -} - -//-------------------------------------------------------------- -void testApp::mousePressed(int x, int y, int button){ - -} - -//-------------------------------------------------------------- -void testApp::mouseReleased(int x, int y, int button){ - -} - -//-------------------------------------------------------------- -void testApp::windowResized(int w, int h){ - -} - -//-------------------------------------------------------------- -void testApp::gotMessage(ofMessage msg){ - -} - -//-------------------------------------------------------------- -void testApp::dragEvent(ofDragInfo dragInfo){ - -} diff --git a/TRRSS_01_rec/src/testApp.h b/TRRSS_01_rec/src/testApp.h deleted file mode 100755 index 225abc8..0000000 --- a/TRRSS_01_rec/src/testApp.h +++ /dev/null @@ -1,106 +0,0 @@ -#pragma once - -//for tomorrow: drawing interface & screengrab - -//thursday: -//2 camera calibration -//recording - whats the best format - in memeory + save at end? -//movie + pixels? - -#include "ofMain.h" -#include "ofxOpenNI.h" - -#include "ofxFensterManager.h" -#include "ofxGui.h" - -#include "ofxMayaCam.h" - -//#define NEWAPI - -class guiWindow; - -class testApp : public ofxFensterListener{ - - public: - void setup(); - void update(); - void draw(); - void exit(); - - void keyPressed (int key); - void keyReleased(int key); - void mouseMoved(int x, int y ); - void mouseDragged(int x, int y, int button); - void mousePressed(int x, int y, int button); - void mouseReleased(int x, int y, int button); - void windowResized(int w, int h); - void dragEvent(ofDragInfo dragInfo); - void gotMessage(ofMessage msg); - - string generateFileName(); - void setupRecording(string _filename = ""); - void setupPlayback(string _filename); - - ofxOpenNIRecorder oniRecorder; - - bool isLive, isRecording; - -#ifdef NEWAPI - ofxOpenNI openNIDevice; - void userEvent(ofxOpenNIUserEvent & event); - -#else - - - ofxOpenNIContext recordContext,playContext; - ofxDepthGenerator recordDepth,playDepth; - ofxImageGenerator recordImage,playImage; - ofxUserGenerator recordUser,playUser; - - ofxImageGenerator *whichImage; - ofxUserGenerator *whichUser; -#endif - - - guiWindow *guiWin; - - ofxMayaCam cam; - -}; - -class guiWindow: public ofxFensterListener{ - public: - ofxPanel gui; - ofxFloatSlider dMin; - ofxParameter<float> distMin; - ofxFloatSlider dMax; - ofxParameter<float> distMax; - ofxIntSlider dStep; - ofxParameter<int> drawStep; - ofxToggle dPoints; - ofxParameter<bool> drawPoints; - ofxFloatSlider pSize; - ofxParameter<float> pointSize; - ofxToggle iOut; - ofxParameter<bool> insideOut; - - - void setup(){ - gui.setup("","panel.xml",0,0); - distMin=400; - gui.add(dMin.setup("min distance",distMin,0,5000,255)); - distMax=2000; - gui.add(dMax.setup("max distance",distMax,0,5000,255)); - drawStep=2; - gui.add(dStep.setup("draw step",drawStep,1,32,255)); - drawPoints=false; - gui.add(dPoints.setup("draw points",drawPoints)); - pointSize=2.0; - gui.add(pSize.setup("point size",pointSize,0.0,20.0,255)); - insideOut=false; - gui.add(iOut.setup("inside out",insideOut)); - } - void draw() { gui.draw(); } - - -}; |
