Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float theta;
- float diam = 70;
- int num = 10;
- color[] palette = {
- #FF0000, #00FF00, #0000FF
- };
- void setup() {
- size(500, 500, P2D);
- background(0);
- blendMode(SCREEN);
- noFill();
- }
- void draw() {
- //background(0);
- fill(0,1);
- noStroke();
- rect(0,0,width, height);
- strokeWeight(diam/2);
- float y = height/2;
- for (int i=1; i<num+1; i++) {
- stroke(palette[(i-1)%3]);
- float x = map(sin(theta), -1, 1, 0, width);
- ellipse(x, y, i*diam, i*diam);
- ellipse(width-x, y, i*diam, i*diam);
- }
- theta += 0.0523/3;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement