動く細胞的ななにか (2024/11/25)
https://gyazo.com/ca5c88e891d895c6a50f26540f6e3cd2 https://gyazo.com/e826ab27615a424e1d0d45b4895dfcc7 https://gyazo.com/b5203ccec5456ee3ee06d4f12e3666b3
https://scrapbox.io/files/674490f9537c08c0b86d91da.mp4
code:processing
//#Processing
int n=200, i, s, k;
float a[]=new floatn*2, m, d, r; void setup() {
size(800, 800);
for (i=0; i<n*2; i++)ai=500-random(1000); }
void draw() {
background(#0080F0);
noStroke();
fill(0, 9);
for (i=0; i<n; i++) {
m=9999;
for (s=0; s<n; s++)if (i!=s)if ((d=dist(ai, ai+n, as, as+n))<m) { m=d;
k=s;
}
if (abs(ai+=sin(r=TAU*noise(ai/9, ai+n/9)))>500)ai*=-1; if (abs(ai+n+=cos(r))>500)ai+n*=-1; for (k=0; k<m*1.5; k+=2)circle(ai+400, ai+n+400, k); }
}