Advertisement
xeromino

deepspaceii

Mar 16th, 2014
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1. int slices = 16;
  2. int pieces = 5;
  3. int num=slices*pieces;
  4. float[] r = new float[num];
  5. int c;
  6. float scal, theta, sw;
  7.  
  8. void setup() {
  9.   size(400, 400);
  10.   noFill();
  11.   strokeCap(SQUARE);
  12.  
  13.   randomSeed(36);
  14.  
  15.   for (int i=0; i<slices; i++) {
  16.     for (int j=0; j<pieces; j++) {
  17.       r[c] = random(j*(width/pieces), (j+1)*(width/pieces));
  18.       c++;
  19.     }
  20.   }
  21. }
  22.  
  23. void draw() {
  24.   //background(#202020);
  25.   fill(#202020, 15);
  26.   noStroke();
  27.   rect(0,0,width, height);
  28.  
  29.   stroke(255);
  30.   noFill();
  31.   c=0;
  32.  
  33.   for (int i=0; i<slices; i++) {
  34.     sw = map(sin(theta+(TWO_PI/num)*c), -1, 1, 5, 80);
  35.     for (int j=0; j<pieces; j++) {
  36.       scal = map(sin(theta+(TWO_PI/num)*c), -1, 1, 1, 3);
  37.  
  38.       strokeWeight(sw);
  39.       arc(width/2, height/2, r[c]*scal, r[c]*scal, (TWO_PI/slices)*i, (TWO_PI/slices)*(i+.7));
  40.       c++;
  41.     }
  42.   }
  43.   theta += 0.0523;
  44.   fill(#ffffff);
  45.   noStroke();
  46.   ellipse(width/2, height/2, 50, 50);
  47.  
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement