#include "ofApp.h" /* so far so good, NOW threading camera + button transitions start with a max size say 64 - should be 16k inc mip maps graphics card has 2048MB 9% in use by ubuntu 117964 textures I wonder is this faster with shared memory.. performance? use opencv to convert to floats? its a quick one.. */ //-------------------------------------------------------------- void ofApp::setup() { ofSetLogLevel(OF_LOG_WARNING); ofSetFrameRate(60); kinect.setRegistration(true); kinect.init(); kinect.open(); //colourImage.allocate(kinect.width, kinect.height); //depthImage.allocate(kinect.width, kinect.height); //floatImage.setNativeScale(0.0f,255.0f); int h=ceil(ofGetHeight()/MAX_TILE_SIZE); //int w=(h*4)/3; //floatImage.allocate(w*FLANN_MATRIX_SIZE,h*FLANN_MATRIX_SIZE); floatImage=new float[h*FLANN_MATRIX_SIZE*h*FLANN_MATRIX_SIZE*3]; //cerr<<"floatImage: "<': case '.': farThreshold ++; if (farThreshold > 255) farThreshold = 255; break; case '<': case ',': farThreshold --; if (farThreshold < 0) farThreshold = 0; break; case 'w': kinect.enableDepthNearValueWhite(!kinect.isDepthNearValueWhite()); break; case 'o': kinect.setCameraTiltAngle(angle); // go back to prev tilt kinect.open(); break; case 'c': kinect.setCameraTiltAngle(0); // zero the tilt kinect.close(); break; case '1': kinect.setLed(ofxKinect::LED_GREEN); break; case '2': kinect.setLed(ofxKinect::LED_YELLOW); break; case '3': kinect.setLed(ofxKinect::LED_RED); break; case '4': kinect.setLed(ofxKinect::LED_BLINK_GREEN); break; case '5': kinect.setLed(ofxKinect::LED_BLINK_YELLOW_RED); break; case '0': kinect.setLed(ofxKinect::LED_OFF); break; case OF_KEY_UP: angle++; if(angle>30) angle=30; kinect.setCameraTiltAngle(angle); break; case OF_KEY_DOWN: angle--; if(angle<-30) angle=-30; kinect.setCameraTiltAngle(angle); break; case OF_KEY_LEFT: mode--; if (mode<0) mode=NUM_MODES-1; break; case OF_KEY_RIGHT: mode=(mode+1)%NUM_MODES; break; case ' ': fullscreen=!fullscreen; ofSetFullscreen(fullscreen); break; } } //-------------------------------------------------------------- void ofApp::mouseDragged(int x, int y, int button) {} //-------------------------------------------------------------- void ofApp::mousePressed(int x, int y, int button) {} //-------------------------------------------------------------- void ofApp::mouseReleased(int x, int y, int button) {} //-------------------------------------------------------------- void ofApp::windowResized(int w, int h) {}