xxxxxxxxxx
62
function setup() {
w = windowHeight;
createCanvas(w, w);
ellipseMode(CENTER);
angleMode(DEGREES);
rectMode(CENTER);
colorMode(HSB, 360);
frameRate(120);
//noLoop();
}
function draw() {
//background
//rotation=0;
rotation=(frameCount*1)%720;
translate(width / 2, height / 2);
rotate(-0.5*rotation);
{
noStroke();
fill(340, 360, 360);
rect(-w/2,0,w,w*2);
fill(250, 360, 250);
rect(w/2,0,w,w*2);
}
fill(340, 360, 360);
ellipse(0, -w/4, w/2);
ellipse(0, 3*w/4, w/2);
fill(250, 360, 250);
ellipse(0, w/4, w/2);
ellipse(0, -3*w/4, w/2);
rotate(rotation);
translate(-width / 2, -height / 2);
max = 9
for(i=0;i<=max;i++) {
for(j=0;j<=max;j++) {
factor = j>max/2? max/2-(j-max/2):j;
r = w/max;
fill((i+j)%2==0? color(340, 360, 360):color(250, 360, 250));
ellipse(w/max*j, w/max*i, r-25);
}
}
max = 15;
translate(width/2, height/2);
rotate(0.5*rotation);
translate(width/3, height/3);
rotate(-rotation*1.1);
limA = -max
for(i=-max;i<=max;i++) {
for(j=-max;j<=max;j++) {
factor = j>max/2? max/2-(j-max/2):j;
r = w/max/2;
//fill((i+j)%2==0? 0:360);
fill((i+j)%2==0? color(340, 360, 360):color(250, 360, 250));
ellipse(w/max*j*(sin(rotation)+2)*(cos(rotation)+2)*1, w/max*i*(sin(rotation)+2)*(cos(rotation)+2)*1, r);
}
}
}