Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- color bg = #202020; // #5D3D6C;
- color f1 = #ffffff; //#A4B595;
- color f2 = #ffffff; // #EA6793;
- float y1, y2, theta, diam1, diam2, l, maxdiam, sw1, sw2;
- int top = 5;
- void setup() {
- size(500, 300);
- background(bg);
- fill(f1);
- stroke(255);
- noStroke();
- l = (width/top);
- maxdiam = .7*(width/top);
- }
- void draw() {
- background(bg);
- for (int i=1; i<top; i++) {
- //fill(f1);
- y1 = map(sin(theta), -1, 1, 100, 200);
- diam1 = map(sin(theta), -1, 1, 5, maxdiam);
- sw1 = map(sin(theta), -1, 1, 1, 5);
- strokeWeight(sw1);
- ellipse(i*l, y1, diam1, diam1);
- }
- for (int i=1; i<top-1; i++) {
- //fill(f2);
- y2 = map(sin(theta), -1, 1, 200, 100);
- diam2 = map(sin(theta), -1, 1, maxdiam, 5);
- sw1 = map(sin(theta), -1, 1, 5, 1);
- strokeWeight(sw1);
- ellipse(l/2+i*l, y2, diam2, diam2);
- }
- theta += 0.0523;
- if (frameCount % 2 == 0 && frameCount<121) saveFrame("image-####.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement