Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int num=50, frames=120;
- long rs;
- float theta;
- void setup() {
- size(750, 500);
- blendMode(DIFFERENCE);
- rs =(long) random(10000);
- //strokeCap(SQUARE);
- rectMode(CENTER);
- }
- void draw() {
- randomSeed(rs);
- background(0);
- for (int i=0; i<num; i++) {
- float x = width/2;
- float y = height/2;
- pushMatrix();
- translate(x,y);
- int speed=int(random(1,4));
- int dir=random(1)>.5?1:-1;
- rotate(theta*dir*speed);
- float w = random(width*.2, width*1.2);
- float h = w;
- float start = random(TWO_PI);
- float end = start + random(PI/4, PI/2);
- stroke(255);
- strokeWeight(random(20,100));
- noFill();
- arc(0, 0, w, h, start, end);
- popMatrix();
- }
- theta += TWO_PI/frames;
- //if (frameCount<=frames) saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement