From 29f6e4f30f1295144464585ad682f582c85e4247 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sat, 3 Feb 2018 19:43:53 +0000 Subject: better phase --- gui/src/ofApp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gui/src/ofApp.cpp') diff --git a/gui/src/ofApp.cpp b/gui/src/ofApp.cpp index e6afd29..8c42309 100644 --- a/gui/src/ofApp.cpp +++ b/gui/src/ofApp.cpp @@ -399,14 +399,15 @@ void ofApp::drawOutput(ofEventArgs & args){ vector polyOutput; - float phase=fmod(ofGetElapsedTimef()*segmenter_speed,1); + phase=fmod(phase+((ofGetElapsedTimef()-prev_time)*segmenter_speed),1); + prev_time=ofGetElapsedTimef(); while (phase<0.0f) { phase+=1.0f; } switch (source){ - case TEST:{ + case TEST:{ ofMatrix4x4 m = ofMatrix4x4::newIdentityMatrix(); m.rotateRad(ofGetElapsedTimef(),0,0,1); m.translate(ofGetWidth()/2,ofGetHeight()/2,0); -- cgit v1.2.3