Advertisement
xeromino

noiseSeed

Jul 5th, 2015
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. int num=80;
  2. long ns;
  3.  
  4. void setup() {
  5.   size(750, 540);
  6.   noStroke();
  7.   mouseReleased();
  8. }
  9.  
  10. void draw() {
  11.   noiseSeed(ns);
  12.   background(255);
  13.   for (int i=0; i<num; i++) {
  14.     float offSet = TWO_PI/num*i;
  15.     pushMatrix();
  16.     translate(width/2, height/2);
  17.     rotate(offSet);
  18.     fill(0, 150);
  19.     float w = noise(sin(offSet)*2, cos(offSet)*3)*300;
  20.     rect(0,50, w, 1);
  21.     popMatrix();
  22.   }
  23.   fill(255);
  24.   ellipse(width/2,height/2,103,103);
  25. }
  26.  
  27. void mouseReleased() {
  28.   ns = (long) random(100000);
  29. }
  30.  
  31. void keyPressed() {
  32.   save(ns+".gif");
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement