地球と街の生成 (2025/8/20)
https://gyazo.com/bdbb866d0388dc21db47b5a60ab542d1 https://gyazo.com/4b8d43c6ee0e4ca30fa59005844ab3d8 https://gyazo.com/06f0b2bfa3e0a1441bf13ab4fdc9a07d
https://scrapbox.io/files/68a5c3f5b490a199c95ea3eb.mp4
code:processing
//#Processing
int n=2000, i, s, m[]=new intn*2; float a[]=new floatn*2, d, e, f, r, t; void setup() {
size(800, 800);
for (i=0; i<n; i++) {
d=99*randomGaussian();
r=random(TAU);
}
}
void draw() {
background(0);
translate(400, 400);
stroke(-1);
for (i=0; i<n; i++) {
e=f=9999;
for (s=0; s<n; s++)if (i!=s) {
if (d<e) {
f=e;
e=d;
} else if (d<f) {
f=d;
}
}
line(ai, ai+n, a[mi], a[mi+n]); ai+=sin(r=TAU*sin(t/d))/5; }
t+=9;
}