diff options
| author | Tim Redfern <tim@getdrop.com> | 2018-02-03 19:43:53 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2018-02-03 19:43:53 +0000 |
| commit | 29f6e4f30f1295144464585ad682f582c85e4247 (patch) | |
| tree | d0d0d480a970eed6003337346d92be901a15aa9e /gui | |
| parent | 20c9f342c3db9041a5a62f9c3158e0ce0b1f2bcb (diff) | |
better phase
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/src/ofApp.cpp | 5 | ||||
| -rw-r--r-- | gui/src/ofApp.h | 1 |
2 files changed, 4 insertions, 2 deletions
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 <colourPolyline> 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); diff --git a/gui/src/ofApp.h b/gui/src/ofApp.h index 6148613..876308c 100644 --- a/gui/src/ofApp.h +++ b/gui/src/ofApp.h @@ -128,6 +128,7 @@ class ofApp: public ofBaseApp, public ofxMidiListener { vector <lineSegmenter> segmenters; set <int> shape_selection; int framecounter; + float phase,prev_time; //to calculate phase //======================================= //Mask clipping |
