Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int num=5, movers=60, d3=50, frames=140;
- float angle, theta, d, d2;
- color bg=#202020;
- void setup() {
- size(540, 540, P2D);
- smooth(5);
- }
- void draw() {
- randomSeed(455);
- background(bg);
- noFill();
- for (int i=0; i<num; i++) {
- angle = TWO_PI/num*i;
- d = map(sin(theta+angle*5), -1, 1, 150, 250);
- float outerX = width/2 + cos(angle)*d;
- float outerY = height/2+sin(angle)*d;
- float cx1 = width/2 + cos(angle)*d*.8;
- float cy1 = height/2+sin(angle)*d*.8;
- d2 = map(sin(theta+angle), -1, 1, 20, 70);
- for (int j=0; j<movers; j++) {
- float offSet = TWO_PI/movers*j;
- float CmoverX = width/2+cos(theta+offSet)*d2;
- float CmoverY = height/2+sin(theta+offSet)*d2;
- CmoverY = abs(CmoverX);
- float moverX = CmoverX + cos(angle+offSet)*d3;
- float moverY = CmoverY + sin(angle)*d3;
- float cx2 = CmoverX + cos(angle)*d3;
- float cy2 = CmoverY + sin(angle+offSet)*d3;
- noFill();
- stroke(#ffffff, 50);
- bezier(outerX, outerY, cx1, cy1, cx2, cy2, moverX, moverY);
- }
- }
- theta += TWO_PI/frames;
- if (frameCount<=frames) saveFrame("image-###.png");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement