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;
             }
         }
     }
 }