Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int num = 10000, frames=60;
- float theta;
- long rs;
- void setup() {
- size(540, 540);
- rs = (long) random(23232323);
- }
- void draw() {
- randomSeed(rs);
- background(20);
- noStroke();
- translate(width/2, height/2);
- for (int i=0; i<num; i++) {
- pushMatrix();
- float r = random(TWO_PI);
- rotate(r);
- float s = 100;
- float d = random(s, height*.35);
- if (random(1)>.9) d = random(s,height*.45);
- //if (random(1)>.97) d = random(s-50,s-10);
- float s2 = s + random(-10,10);
- float x = map(sin(theta+random(TWO_PI)), -1, 1, s2, d);
- float sz = random(1, 2);
- fill(255,150);
- ellipse(x, 0, sz, sz);
- //line(100,0,x,0);
- popMatrix();
- }
- theta += TWO_PI/frames;
- //if (frameCount<=frames) saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement