xxxxxxxxxx
let f=0;
let W=400;
setup=_=> {
createCanvas(W,W,WEBGL)
}
draw=_=> {
[9,-9].map(i => pointLight([W],0,i*W,-W*i));
noStroke();
rotateX(1);
for(i=0; i<32; i+=16){
push(I=i*PI/16);
translate(0,0,sin(f+I)*43);
scale(1,1,4);
pop(torus(80-cos(f+I)*25,9,4,30));
}
sphere(W);
translate(0,0,abs(sin(f)*99));
sphere(20);
f+=0.04;
}
// ----------------------------------------
// Minimized
// ----------------------------------------
// f=0,draw=a=>{for(f||createCanvas(W=400,W,WEBGL,T=translate,S=sphere),[9,-9].map(a=>pointLight([W],a*W,-W*a)),f+=.04,rotateX(1),i=48;i-=16;)push(I=i*PI/16),T(0,0,43*sin(f+I)),scale(1,1,4),pop(torus(80-25*cos(f+I),9,4,W));S(W,W),T(0,0,abs(140*sin(f))),S(20,W)};//#つぶやきProcessing
// ----------------------------------------
// Pre-compressed
// ----------------------------------------
// f=0
// draw=_=> {
// f||createCanvas(W=400,W,WEBGL,T=translate,S=sphere)
// ;[9,-9].map(i => pointLight([W],i*W,-W*i))
// f+=.04
// rotateX(1)
// i=48
// while(i-=16){
// push(I=i*PI/16)
// T(0,0,sin(f+I)*43)
// scale(1,1,4)
// pop(torus(80-cos(f+I)*25,9,4,W))
// }
// S(W,W)
// T(0,0,abs(sin(f)*99))
// S(20,W)
// }