xxxxxxxxxx
67
function setup() {
createCanvas(windowWidth, windowHeight);
angleMode(DEGREES);
noStroke();
radius = 270;
}
function draw() {
background(220);
translate(width/2, height/2);
for(i=0;i<3;i++) {
push();
rotate(120*i);
translate(radius*0.577, 0);
rotate(-frameCount);
fill(0);
arc(0, 0, radius, radius, 0, 180);
fill(255);
arc(0, 0, radius, radius, 180, 0);
push();
translate(radius/4, 0);
//rotate(-frameCount);
fill(0);
ellipse(0, 0, radius/2);
for(j=0;j<3;j++) {
push();
rotate(j*120+frameCount);
translate(radius/8, 0);
rotate(180+3*frameCount);
fill(255);
arc(0, 0, radius/4, radius/4, 180, 0);
fill(0);
ellipse(-radius/16, 0, radius/8);
fill(255);
ellipse(radius/16, 0, radius/8);
pop();
}
pop();
push();
translate(-radius/4, 0);
fill(255);
ellipse(0, 0, radius/2);
for(j=0;j<3;j++) {
push();
rotate(j*120+frameCount);
translate(radius/8, 0);
rotate(-3*frameCount);
fill(0);
arc(0, 0, radius/4, radius/4, 0, 180);
fill(0);
ellipse(radius/16, 0, radius/8);
fill(255);
ellipse(-radius/16, 0, radius/8);
pop();
}
pop();
pop();
}
}