Advertisement
xeromino

horch

Jan 8th, 2014
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. float theta, var, th, sw, max, r;
  2.  
  3. void setup() {
  4.   size(500, 300);
  5.   strokeCap(SQUARE);
  6. }
  7.  
  8. void draw() {
  9.   background(#202020);
  10.  
  11.   max = 40;
  12.   sw = map(sin(theta), -1, 1, 10, max);
  13.   th = map(sin(theta), -1, 1, 0.8, 0.1);
  14.   var = map(sin(theta), -1, 1, -0.1, 1.5);
  15.   r = TAU/2;
  16.  
  17.   for (int i=1; i<5; i++) {
  18.     noStroke();
  19.     fill(#777777);
  20.     float x = i*70+(i-1)*50;
  21.     arc(x, height/2, 70+max, 70+max, 0, TAU);
  22.     stroke(#FCD300);
  23.     strokeWeight(sw);
  24.     noFill();
  25.     arc(x, height/2, 70+(max-sw), 70+(max-sw), i*r+PI*var, i*r+PI*(var+th));
  26.   }
  27.   theta += 0.0523;
  28.  
  29.   if (frameCount%2==0 && frameCount<121) saveFrame("image-###.gif");
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement