Advertisement
xeromino

shattered

Jan 27th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. float segmentCount, angleStep, radius;
  2.  
  3. void setup() {
  4.   size(800, 800);
  5.   colorMode(HSB, 360, 100, 100);
  6.   stroke(350);
  7.   strokeWeight(20);
  8. }
  9.  
  10. void draw() {
  11.   background(350);
  12.   segmentCount = 7;
  13.   angleStep=360/segmentCount;
  14.  
  15.   float div = 5;
  16.   float inc = 0;
  17.   radius = width/div;
  18.  
  19.   beginShape(TRIANGLE_FAN);
  20.   vertex(width/2, height/2);
  21.   for (float angle=0;angle <=360*6; angle+=angleStep) {
  22.     float vx = width/2 + inc + cos(radians(angle))*radius;
  23.     float vy = height/2 + inc + sin(radians(angle))*radius;
  24.     vertex(vx, vy);
  25.     fill(angle%360, 100, 90,50);
  26.     radius *=random(0.97,1.04);
  27.     inc += random(-5,5);
  28.   }
  29.   endShape();
  30.  
  31.  
  32.   noLoop();
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement