You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.1 KiB
Plaintext

4 years ago
float angle = 0;
float r = 25; //radii of outer rotating circles
float rtwo = 3; //radii of golden circles
float n = 100; //number of golden circles
int numFrames = 300;
void setup() {
size(500,500);
background(59, 79, 88);
}
void draw() {
background(59, 79, 88);
noStroke();
fill(69,216,184);
pushMatrix();
stroke(69,216,184);
fill(69,216,184,100);
translate(width/2,height/2);
for (int i=0; i < 7; i++) {
ellipse(0,-25,50,50);
rotate(2*PI/6);
}
popMatrix();
pushMatrix();
noStroke();
fill(217,169,80);
translate(width/2,height/2);
for (int i=0; i < n+1; i++) {
ellipse(0,-150,rtwo,rtwo);
rotate(2*PI/n);
}
popMatrix();
float n = norm(frameCount % numFrames, 0, numFrames);
angle = lerp(0, TWO_PI, n);
pushMatrix();
translate(width/2,height/2);
rotate(angle-PI/2);
fill(69,216,184,255);
ellipse(150*cos(2*PI/3),150*sin(2*PI/3),r,r);
ellipse(150*cos(4*PI/3),150*sin(4*PI/3),r,r);
ellipse(150*cos(6*PI/3),150*sin(6*PI/3),r,r);
// angle = (.005*PI + angle)%(2*PI);
println(150*cos(2*PI/3));
popMatrix();
}