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