Example #1
0
    void update() {
        if( goFullscreen == 2 ){
            ofSetFullscreen(false);
            ofSetWindowPosition(1920, 0);
        }
        if( goFullscreen == 4 ){
            ofSetFullscreen(true);
            ofViewport(ofGetNativeViewport());
        }
        goFullscreen++;
        if(goFullscreen > 4 && ofGetWindowPositionX() < 1440) {
            goFullscreen = 0;
        }
        
        renderTimer.tick();
        while(osc.hasWaitingMessages()) {
            ofxOscMessage msg;
            osc.getNextMessage(&msg);
            if(msg.getAddress() == "/lookAngle/set") {
                targetLookAngle = msg.getArgAsFloat(0);
            }
            if(msg.getAddress() == "/lookAngle/add") {
                targetLookAngle += msg.getArgAsFloat(0);
                ofLog() << "targetLookAngle: " << targetLookAngle;
            }
            if(msg.getAddress() == "/screenshot") {
                saveScreen("button/");
            }
        }
        lookAngle = ofLerp(lookAngle, targetLookAngle, .1);
        if(screenshotTimer.tick()) {
//            saveScreen("automatic/"); // uncomment to enable automatic screenshot
        }
	}
Example #2
0
	void update()
	{
		while (osc_in.hasWaitingMessages())
		{
			ofxOscMessage m;
			osc_in.getNextMessage(&m);
			
			float t = m.getArgAsFloat(0);
			video.setTime(t);
			
			ext_time = t;
		}
		
		video.update();
	}
Example #3
0
 void receiveOsc() {
     while(oscReceive.hasWaitingMessages()) {
         ofxOscMessage msg;
         oscReceive.getNextMessage(&msg);
         for(int i = 0; i < msg.getNumArgs(); i++) {
             float x = msg.getArgAsFloat(i);
             switch(i) {
                 case 0: remote.nwLength = x; break;
                 case 1: remote.nwSpeed = x; break;
                 case 2: remote.neLength = x; break;
                 case 3: remote.neSpeed = x; break;
                 case 4: remote.seLength = x; break;
                 case 5: remote.seSpeed = x; break;
                 case 6: remote.swLength = x; break;
                 case 7: remote.swSpeed = x; break;
             }
         }
     }
 }
Example #4
0
	void setup()
	{
		ofSetFrameRate(60);
		ofSetVerticalSync(true);
		ofBackground(0);
		
		video.loadMovie("../../../../../examples/video/videoPlayerExample/bin/data/movies/fingers.mov");
		osc_in.setup(9999);
		
		ext_time = 0;
	}
Example #5
0
	void setup() {
        ofBackground(0);
        ofHideCursor();
        
        cam.setup();
        cam.set("","Black Syphon");
        fisheye.setup();
        
        screenshotTimer.setPeriod(60);
        
        ofXml config;
        config.load("config.xml");
        osc.setup(config.getIntValue("osc/port"));
        
        oculusRift.baseCamera = &camera;
        oculusRift.setup();
	}
Example #6
0
    void setup() {
        ofBackground(255);
        ofSetFrameRate(60);
        
        config.load("config.xml");
        defaultLength = config.getFloatValue("cable/length/default");
        minLength = config.getFloatValue("cable/length/min");
        maxLength = config.getFloatValue("cable/length/max");
        host = config.getValue("osc/host");
        sendPort = config.getIntValue("osc/sendPort");
        receivePort = config.getIntValue("osc/receive");
        
        oscSend.setup(host, sendPort);
        oscReceive.setup(receivePort);
        
        local.setup("Local");
        remote.setup("Remote");
        
        zeros.setup("Zeros");
        zeros.add(nwZero.setup("NW Zero"));
        zeros.add(neZero.setup("NE Zero"));
        zeros.add(seZero.setup("SE Zero"));
        zeros.add(swZero.setup("SW Zero"));

        nwZero.addListener(this, &ofApp::zeroNW);
        neZero.addListener(this, &ofApp::zeroNE);
        seZero.addListener(this, &ofApp::zeroSE);
        swZero.addListener(this, &ofApp::zeroSW);
        
        local.gui.loadFromFile("settings.xml");
        
        local.gui.setPosition(10, 10);
        zeros.setPosition(10, 200);
        remote.gui.setPosition(10, 310);
        
    }