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