霧の中 (2024/12/19)
https://gyazo.com/bd4728b72ce0f978a8e677679e90ff50 https://gyazo.com/5efe50d7e25b62ca944f2130562392c8 https://gyazo.com/5aaf47c120f712530c299e6675ee57f5
https://scrapbox.io/files/67642febd4cb07317d3587c0.mp4
本当はmin()じゃなくてconstrain()を使いたかったけど、コードが2ポストに収まらなくなるので諦めた。
code:processing
//#Processing
int f=400, n=f*5, i, s;
float a[]=new floatn*3, r, p, t, c; void setup() {
size(800, 800, P3D);
for (i=0; i<n*3; )ai++=f-random(f*2); }
void draw() {
background(-1);
camera(f, f, f, 0, 0, 0, 0, 0, -1);
for (i=0; i<n; i++) {
if (mag(ai, ai+n)<r)for (s=i+1; s<n; s++)if (mag(as, as+n)<r&dist(ai, ai+n, as, as+n)<50) { stroke(0, 255-dist(f, f, ai, ai+n)/3); }
if (abs(ai+=sin(p=TAU*noise(ai/(c=f*(cos(t)+2)), ai+n/c)))>f)ai*=-1; if (abs(ai+n+=cos(p))>f)ai+n*=-1; }
r++;
t+=.01;
}