再帰であそぶ (2026/5/7)
https://gyazo.com/a5471f210e6bcedaa7bf717eb4debbc0 https://gyazo.com/c1c1d68c797efcc4256ba43bcd6435db https://gyazo.com/fc5e4ef46870ceb8a7f580bea962992f
https://scrapbox.io/files/69fca4654a47cec3dce432d0.mp4
前にも似たようなの作ったし、だんだん作るものがワンパターン化してきたけど…まあ、良いのだ。
code:processing
//#Processing
float t;
void setup() {
size(800, 800, P3D);
}
void draw() {
background(-1);
camera(200, 700*cos(t), 500*cos(t/2), 0, 0, 99, 0, 0, -1);
a(0, 0, 200);
t+=PI/500;
}
void a(float x, float y, float d) {
float r, p, q;
if (d>9) {
push();
translate(x, y, d/2);
beginShape();
for (r=0; r<TAU; r+=TAU/(4.5-1.5*cos(t))) {
vertex(p=d*sin(r), q=d*cos(r));
a(p, q, d/2);
}
endShape(2);
pop();
}
}