Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int edge = 75, cols = 7;
- int step, frms = 120;
- float theta;
- void setup() {
- size(750, 540);
- noStroke();
- step = int((height-2*edge)/cols);
- }
- void draw() {
- background(0);
- randomSeed(100);
- for (int x=edge+step/2; x<width-edge; x += step) {
- for (int y=edge+step/2; y<height-edge; y += step) {
- float distance = dist(x, y, width/2, height/2);
- float offSet = map(distance, 0, sqrt(sq(width/2-edge)+sq(height/2-edge)), 0, PI);
- float sz = map(sin(-theta+offSet), -1, 1, step*.85, step*1.2);
- float sz2 = step *.8;
- float a = map(sin(-theta+offSet), -1, 1, 50, 150);
- for (int i=0; i<5; i++) {
- fill(255, a+i*5);
- ellipse(x, y, sz-i*3, sz-i*3);
- }
- fill(0);
- if (random(1)>.2) ellipse(x, y, sz2, sz2);
- }
- }
- theta += TWO_PI/frms;
- //if (frameCount<frms) saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement