再帰であそぶ その2 (2024/12/5)
https://gyazo.com/fd7843d67ef0d915195359933a7faf11 https://gyazo.com/a77f78e95bfcb655c45690455660cbbb https://gyazo.com/5d1699f1f173ca8a2fb2e9a9b30e20bf
https://scrapbox.io/files/6751ad07aec066e042cec04d.mp4
なんか建物の透視図っぽい感じに。
code:processing
//#Processing
float t;
void setup() {
size(800, 800, P3D);
}
void draw() {
background(0);
stroke(-1);
noFill();
camera(900*sin(t), 900*cos(t), 500, 0, 0, 0, 0, 0, -1);
a(200);
t+=.01;
}
void a(float d) {
if (d>5) {
b(d, d, 2);
b(-d, d, 4);
b(d, -d, 6);
b(-d, -d, 8);
}
}
void b(float p, float q, float r) {
if (noise(p, q, t)<r/9) {
push();
translate(p, q);
box(abs(p));
a(abs(p)/2);
pop();
}
}