Advertisement
xeromino

argh

Jan 6th, 2015
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.90 KB | None | 0 0
  1. int num=20, num2=8, frames=100;
  2. float angle, diam, x, y, theta;
  3.  
  4. void setup() {
  5.   size(500, 500);
  6.   noStroke();
  7.   colorMode(HSB, 360, 100, 100);
  8. }
  9.  
  10. void draw() {
  11.   randomSeed(23323);
  12.   background(#202020);
  13.   angle=0;
  14.   translate(width/2, height/2);
  15.   for (int j=0; j<num2; j++) {
  16.     num =int(map(j, 0, num2-1, 20, 10));
  17.     beginShape();
  18.     for (int i=0; i<num; i++) {
  19.       float br = map(j, 0, num2-1, 90, 20);
  20.       fill(150, 80, br);
  21.       float scal = map(j, 0, num2-1, .35, .05);
  22.       float r = map(j, 0, num2-1, 15, 10);
  23.       diam = width*scal+random(r);
  24.       float v = map(sin(theta+random(TWO_PI)), -1, 1, 1, random(1, 1.2));
  25.       x = sin(angle*i)*diam*v;
  26.       y = cos(angle*i)*diam*v;
  27.       if (i==0) curveVertex(x, y);
  28.       curveVertex(x, y);
  29.       if (i==num-1) curveVertex(x, y);
  30.       angle = TWO_PI/num;
  31.     }
  32.     endShape(CLOSE);
  33.   }
  34.   theta += TWO_PI/frames;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement