From 03eacae3ff028f7e565b3aebf28af48a0b08c585 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Fri, 18 Aug 2023 15:53:23 +0100 Subject: starfield randomisation --- lasertext/src/ofApp.h | 53 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 6 deletions(-) (limited to 'lasertext/src/ofApp.h') 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 speed; ofParameter lifespan; ofParameter bScan; + ofParameter mixprob; + ofParameter 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)birthday>it->lifespan){ @@ -78,7 +119,7 @@ public: ++it; } } - if (ofRandom(rate) stars; - - starSystem stars; + //vector stars //!!not easy + starSystem stars1; + starSystem stars2; glm::vec2 warpframe[4]; int select_warpframe; -- cgit v1.2.3