diff options
Diffstat (limited to 'lasertext/src/ofApp.h')
| -rw-r--r-- | lasertext/src/ofApp.h | 53 |
1 files changed, 47 insertions, 6 deletions
diff --git a/lasertext/src/ofApp.h b/lasertext/src/ofApp.h index bd92da1..38038e3 100644 --- a/lasertext/src/ofApp.h +++ b/lasertext/src/ofApp.h @@ -10,6 +10,25 @@ #include "colourPolyline.h" #include "vectortext.h" +/* +priorities 2023 + +1. make the starfields dynamic / colour + +- different modes: + + gravity + + parameters changing on a cycle ie life, speed + + overall + +2. make the text display take an override sentence + +3. artnet receiver that makes (for instance) each letter of the text addreessable as if it was an LED + +*/ + class scannableColourPolyline: public colourPolyline{ public: bool operator < (const scannableColourPolyline& line) const { @@ -47,6 +66,12 @@ public: ofParameter<float> speed; ofParameter<float> lifespan; ofParameter<bool> bScan; + ofParameter<float> mixprob; + ofParameter<bool> bRandomise; + + float this_rate; + float last_rate; + starSystem(){ } void init(string name="",int _gx=5, int _gy=5, float _x=0, float _y=0, float _rad=100,float r=0.5,float s=5.0,float l=5.0,float v=1.0){ @@ -54,18 +79,34 @@ public: agevar=v; gui.setup(name,"",_gx,_gy); - gui.add(x.set("x", _x, -2000.0f, 2000.0f)); - gui.add(y.set("y", _y, -2000.0f, 2000.0f)); + gui.add(x.set("x", _x, -4000.0f, 4000.0f)); + gui.add(y.set("y", _y, -4000.0f, 4000.0f)); gui.add(rate.set("rate", r, 0.01f, 3.0f)); gui.add(radius.set("radius", _rad, 10.0f, 500.0f)); gui.add(speed.set("speed", s, 0.0f, 10.0f)); gui.add(lifespan.set("life", l, 3.0f, 10.0f)); gui.add(bScan.set("scan", true)); + gui.add(mixprob.set("mix probability", 0.001f, 0.0f, 0.01f)); + gui.add(bRandomise.set("randomise", true)); + + this_rate=rate; + last_rate=rate; } void update(){ float now=ofGetElapsedTimef(); float segment=now-last; last=now; + + if (rate!=last_rate){ + last_rate=rate; + this_rate=rate; + } + + if (bRandomise&&(ofRandom(1.0f)<mixprob)){ + stars.clear(); + this_rate=ofRandom(rate); + } + for(auto it = stars.begin(); it != stars.end();) { if(now-it->birthday>it->lifespan){ @@ -78,7 +119,7 @@ public: ++it; } } - if (ofRandom(rate)<segment){ + if (ofRandom(this_rate)<segment){ float a=ofRandom(3.57f); float r=ofRandom(radius); ofVec2f offset=ofVec2f(cos(a)*r,sin(a)*r); @@ -179,9 +220,9 @@ class ofApp : public ofBaseApp{ ofxXmlSettings XML; - //vector<starSystem> stars; - - starSystem stars; + //vector<starSystem> stars //!!not easy + starSystem stars1; + starSystem stars2; glm::vec2 warpframe[4]; int select_warpframe; |
