Advertisement
xeromino

hardrain

Mar 26th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. int num = 100;
  2. float[] posX = new float[num];
  3. float unit, theta, x;
  4.  
  5. void setup() {
  6.   size(500, 500);
  7.   noFill();
  8.   stroke(0);
  9.   strokeWeight(1);
  10.   unit = width/num;
  11. }
  12.  
  13.  
  14. void draw() {
  15.   background(255);
  16.   for (int i=0; i<num; i++) {
  17.     x = map(sin(theta+(TWO_PI/num)*i), -1, 1, i*unit, width/2);
  18.     line(x, 0, x+random(50), height);
  19.   }
  20.   theta += 0.0523;
  21.  
  22.   //if (frameCount%4==0 && frameCount<121) saveFrame("image-###.gif");
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement