Advertisement
xeromino

3nrel

Jan 2nd, 2015
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. int num=40, frames=200;
  2. float theta;
  3.  
  4. void setup() {
  5.   size(500, 500);
  6.   blendMode(EXCLUSION);
  7. }
  8.  
  9. void draw() {
  10.   background(20);
  11.   for (int i=0; i<num; i++) {
  12.     pushMatrix();
  13.     translate(width/2, height/2);
  14.     float r = TWO_PI/num*i;
  15.     rotate(r);
  16.     float offSet = r*5;
  17.     float x = map(sin(theta+offSet), -1, 1, 20, width*.4);
  18.     float min = 25;
  19.     float max = 60;
  20.     float sz = map(sin(theta+offSet), -1, 1, max, min);
  21.     fill(255);
  22.     noStroke();
  23.     ellipse(x, 0, sz, sz);
  24.     popMatrix();
  25.   }
  26.   theta += TWO_PI/frames;
  27.   if (frameCount<=frames) saveFrame("image-###.gif");
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement