Advertisement
xeromino

quickie2

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