Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- color bg =#ffffff;
- color f = #000000;
- float x,y, theta, theta2, offset, diam;
- void setup() {
- size(500,500);
- background(bg);
- fill(f,5);
- //noStroke();
- //noFill();
- stroke(f,150);
- }
- void draw() {
- //background(bg);
- offset = map(sq(sin(theta2)),-1,1,-20,30);
- diam = map(sin(theta2),-1,1,30,60);
- x = width/2 + offset + sin(theta)*150;
- y = height/2 + cos(theta)*150;
- ellipse(x,y,diam,diam);
- theta += 0.0523/3;
- theta2 += 0.0523*2;
- println(frameCount);
- if (frameCount % 5 == 0) saveFrame("image-####.gif");
- if (theta > TAU) noLoop();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement