Advertisement
xeromino

ouroboros

Nov 23rd, 2013
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. color bg =#ffffff;
  2. color f = #000000;
  3. float x,y, theta, theta2, offset, diam;
  4.  
  5. void setup() {
  6.   size(500,500);
  7.   background(bg);
  8.   fill(f,5);
  9.   //noStroke();
  10.   //noFill();
  11.   stroke(f,150);
  12. }
  13.  
  14. void draw() {
  15.   //background(bg);
  16.   offset = map(sq(sin(theta2)),-1,1,-20,30);
  17.   diam = map(sin(theta2),-1,1,30,60);
  18.   x = width/2 + offset + sin(theta)*150;
  19.   y = height/2 + cos(theta)*150;
  20.  
  21.   ellipse(x,y,diam,diam);
  22.  
  23.   theta += 0.0523/3;
  24.   theta2 += 0.0523*2;
  25.  
  26.   println(frameCount);
  27.   if (frameCount % 5 == 0) saveFrame("image-####.gif");
  28.   if (theta > TAU) noLoop();
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement