コード
float r = 200;
float t;
void setup() {
size(960, 540, P3D);
blendMode(ADD);
colorMode(HSB, 360, 100, 100, 100);
}
void draw() {
background(frameCount%360, 80, 0);
strokeWeight(3);
translate(width/2, height/2);
for (float i = 0; i < 0.5*10; i+= 0.01) {
stroke((frameCount+i*3)%360, 50, 100, 5);
line(x1(t+i), y1(t-i), x2(t+i), y2(t-i));
}
t += 0.03;
}
float x1(float t) {
return sin(t / 7) * r * sin(t / 5)*2.55;
}
float y1(float t) {
return cos(t / 3) * r * cos(t / 7) * 2.2;
}
float x2(float t) {
return sin(t / 11) * r * sin(t / 7)*2.55;
}
float y2(float t) {
return cos(t / 5) * r * cos(t / 11) * 2.2;
}
リファレンス
archive.org