Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int num = 20;
- //int steps = 120;
- float theta; //, r;
- int maxFrameCount = 120;
- float t;
- void setup() {
- size(500, 500);
- //frameRate(25);
- }
- void draw() {
- background(255);
- t = (float)frameCount/maxFrameCount;
- theta = TWO_PI*t;
- translate(width/2, height/2);
- pushMatrix();
- rotate(theta/num);
- for (int i=0; i<num; i++) {
- pushMatrix();
- float offSet = TWO_PI/num*i;
- rotate(offSet);
- float sz = map(sin(theta+offSet), -1, 1, 5, 40);
- ellipse(150, 0, sz, sz);
- popMatrix();
- }
- popMatrix();
- if (frameCount%1==0 && t<=1) saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement