Advertisement
xeromino

splitCircle

Nov 17th, 2013
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. color bg = #95729C;
  2. color str = #B7AACF;
  3. float theta, arcFin, diam, num;
  4.  
  5. void setup() {
  6.   size(500, 500);
  7.   background(bg);
  8.   noFill();
  9.   stroke(str);
  10.   strokeCap(SQUARE);
  11.   diam = 200;
  12.   num = 2;
  13. }
  14. void draw() {
  15.  
  16.   background(bg);
  17.  
  18.   for (int i=0; i<num; i++) {
  19.     float step = TAU/num;
  20.     arcFin = map(sin(theta), -1, 1, i*step+ radians(1), i*step + step + radians(-2));
  21.     float sw = map(sin(theta), -1, 1, 20, 50 );
  22.     strokeWeight(sw);
  23.     arc(width/2, height/2, diam, diam, i*step, arcFin);
  24.   }
  25.  
  26.   theta += 0.0523;
  27.  
  28.   if (frameCount % 2 == 0 & frameCount<121) saveFrame("image-####.gif");
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement