Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ArrayList thingies = new ArrayList();
- float limit, r1, r2, org_x, org_y;
- float sw = 70;
- float diam = 350;
- color bg = #3C3658;
- color s = #F7E0AE;
- void setup() {
- size(500, 500);
- background(bg);
- strokeCap(SQUARE);
- noFill();
- org_x = width/2;
- org_y = height/2;
- float theta = 0;
- float start = 0;
- float end = 0;
- while (end < 360) {
- r1 = random(1, 3);
- r2 = random(10, 20);
- theta = random(TAU);
- start = end + r1;
- end = start + r2;
- Thingie thingie = new Thingie(theta, start, end);
- thingies.add(thingie);
- }
- }
- void draw() {
- background(bg);
- for (int i=0; i<thingies.size();i++) {
- Thingie thing = (Thingie) thingies.get(i);
- thing.run();
- }
- //if (frameCount % 4 == 0 && frameCount <220) saveFrame("image-###.gif");
- }
- class Thingie {
- float theta, t, start, end;
- Thingie(float _theta, float _start, float _end) {
- theta= _theta;
- start = radians(_start);
- end = radians(_end);
- }
- void run() {
- move();
- display();
- }
- void move() {
- t = map(sin(theta),-1, 1, 0.0523, 0.0523/4);
- theta += t;
- start += t;
- end += t;
- }
- void display() {
- //stroke(s,50);
- strokeWeight(sw);
- fill(s,50);
- noFill();
- stroke(s,150);
- arc(org_x,org_y,diam,diam,start,end);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement