Advertisement
tequibo

cloning bees and bombs

Sep 16th, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. int circles = 12;
  2. int steps = 60;
  3. float theta, r;
  4.  
  5. void setup() {
  6. size(500, 500);
  7. frameRate(25);
  8. }
  9. void draw() {
  10. background(#5E8795);
  11. translate(width/2, height/2);
  12. pushMatrix();
  13. //rotate(-r);
  14. for (int i=0; i<circles; i++) {
  15. pushMatrix();
  16. float offSet = TWO_PI/circles*float(i);
  17. rotate(offSet+r);
  18. float sz = map(sin(theta+offSet), -1, 1, 20, 50);
  19. noStroke();
  20. fill(#EEC294);
  21. ellipse(150, 0, sz, sz);
  22. popMatrix();
  23. }
  24. popMatrix();
  25. r += (TWO_PI/steps/circles);
  26. theta = r*circles*((TWO_PI+TWO_PI/circles)/TWO_PI);
  27. if (frameCount%1==0 && frameCount<steps+1) saveFrame("frames/image-###.gif");
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement