コード
void setup() {
size(960, 540);
colorMode(HSB, 360, 100, 100, 100);
blendMode(ADD);
smooth();
stroke(0, 0, 100);
frameRate(2);
}
void draw() {
background(220, 40, 20);
translate(width/2, height/2);
float n = frameCount%10+3;
for (float angle = 0; angle < 360; angle += 360/n) {
float theta = radians(angle);
float x = cos(theta) * 250;
float y = sin(theta) * 250;
beginShape();
fill(angle, 100, 100, 100/n*5);
for (float angle2 = 0; angle2 < 360; angle2 += 360/n) {
float theta2 = radians(angle2);
float x2 = x /2 + cos(theta2) * 250 /2;
float y2 = y /2 + sin(theta2) * 250 /2;
vertex(x2, y2);
}
endShape(CLOSE);
}
}