和菓子 (2024/10/28)
https://gyazo.com/1ff1dee9d1412000c1e9577d7a3121ce https://gyazo.com/5f98c97ed3f71595f7e24c8c0b81cbfe
https://scrapbox.io/files/671f9fb8db589106dde309da.mp4
code:processing
//#Processing Japanese sweets
float x, y, r, t, k;
void setup() {
size(800, 800, P3D);
background(0);
}
void draw() {
camera(0, 0, 300, 900, 900, 0, 0, 0, -1);
if (t>PI) {
t=0;
background(0);
}
for (x=1; x<6; x++)for (y=1; y<6; y++) {
beginShape();
for (r=0; r<TAU; r+=PI/99) {
if (t<PI/2)stroke(x*50, y*50, 0);
vertex((k=60*sin(t))*sin(r*x)+x*160, k*cos(r*y)+y*160, 50*cos(t));
}
endShape(2);
}
t+=.01;
}