Advertisement
xeromino

oldie

Jan 2nd, 2017
770
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int num =20, frms = 120;
  2. float step, sz, offSet, theta;
  3.  
  4. void setup() {
  5.   size(540, 540, P2D);
  6.   smooth(8);
  7.   strokeWeight(5);
  8.   strokeCap(SQUARE);
  9.   step = 20;
  10. }
  11.  
  12. void draw() {
  13.   background(34);
  14.   translate(width/2, height/2);
  15.   for (int i=0; i<num; i++) {
  16.     //stroke(360/num*i, 90, 90);
  17.     stroke(238);
  18.     if (i%7==0) stroke(225,76,69);
  19.     noFill();
  20.     sz = i*step;
  21.     float offSet = TWO_PI/num*i;
  22.     float arcEnd = map(sin(theta+offSet), -1, 1, PI/2, TWO_PI+PI/2);
  23.     arc(0, 0, sz, sz, PI, arcEnd);
  24.   }
  25.   theta += TWO_PI/frms;
  26.   if (frameCount<frms) saveFrame("image-###.gif");
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement