岩と湖 (2024/12/10)
https://gyazo.com/11c530caebcf48b951c1b9e197998a8c https://gyazo.com/14a2c6df1f81d11bad9dbce5525ebdf0 https://gyazo.com/c39bb1f23cb3f0b63a36ea00468a0b0e
code:processing
//#Processing
float r, i, a, b, t, x, y, c=5, d=2, f=400, n;
void setup() {
size(800, 800, P3D);
strokeWeight(2);
}
void draw() {
background(0);
camera(f, f, f, 0, 0, 0, 0, 0, -1);
for (x=-f; x<f; x++)for (y=-f; y<f; y++) {
r=i=n=0;
a=x/f-1;
b=y/f;
while ((r*r+c*c*c*i*i<4)&n<256) {
t=r*r-i*i+a;
i=d*r*i+b;
r=t;
n++;
}
if (n<255) {
stroke(sq(n)%256);
} else {
stroke(0, 0, 180-c*50);
}
point(x, y, -(sq(n)%256)/5);
}
if (c>-5)c-=.1;
else d*=1.01;
}