Advertisement
xeromino

arc_quickie

Jan 3rd, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. float slices = 24;
  2. float orgX, orgY, theta;
  3.  
  4. void setup() {
  5.   size(500, 500);
  6.   background(255);
  7.   orgX = width/2;
  8.   orgY = height/2;
  9. }
  10.  
  11.  
  12. void draw() {
  13.  
  14.   background(255);
  15.  
  16.   for (int i=0; i<slices;i++) {
  17.     float unit = TAU/slices;
  18.     if (i%2==0) {
  19.       fill(#480D4A);
  20.     }
  21.     else {
  22.       fill(#BB1C60);
  23.     }
  24.  
  25.     noStroke();
  26.     float sz = map(sin((i*unit+theta)), -1, 1, 200, 400);
  27.     arc(orgX, orgY, sz, sz, i*unit, (i+1)*unit);
  28.   }
  29.  
  30.   theta += 0.0523;
  31.  
  32.   if (frameCount % 4 == 0 && frameCount < 121) saveFrame("image-####.gif");
  33.  
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement