For faster rendering use 8000, 4000 or 2000 instead of 64000 in TAU/64000
xxxxxxxxxx
let f = 0;
let W = 400;
setup = _ => {
createCanvas(800, W, WEBGL);
noStroke();
}
draw = _ => {
rotateX(-0.8);;
[W, -W, 100].map(i => pointLight([i], 0, -i, i));
for (i = 0; i < TAU; i += TAU / 64000) { // !!! final quality = 64000. For faster render try: 8000, 4000, 2000, ...
push()
let F = (f + i * 99) % W + i;
let Y = abs(sin(f / 44 - F / 33)) * -99;
rotateY(F);
translate(F, Y);
fill(-Y * 3);
sphere(4 - F / 99, 8);
pop();
}
box(3000);
f++;
}
// ----------------------------------------
// Pre-Minimized
// ----------------------------------------
// f=0
// draw=_=>{
// f++||createCanvas(800,W=400,WEBGL,T=translate)
// rotateX(-.8)
// ;[W,-W,100].map(i=>pointLight([i],0,-i,i))
// for(i=0;i<TAU;i+=TAU/64000){
// push()
// rotateY(F=(f+i*99)%W+i)
// T(F,Y=abs(sin(f/44-F/33))*-99)
// fill(-Y*3)
// pop(sphere(4-F/99,W))
// }
// box(3000)
// }
// ----------------------------------------
// Minimized
// ----------------------------------------
// f=0,draw=a=>{for(f++||createCanvas(800,W=400,WEBGL,T=translate),rotateX(-.8),[W,-W,100].map(a=>pointLight([a],0,-a,a)),i=0;i<TAU;i+=TAU/64e3)push(),rotateY(F=(f+99*i)%W+i),T(F,Y=-99*abs(sin(f/44-F/33))),fill(3*-Y),pop(sphere(4-F/99,W));box(3e3)};//#つぶやきProcessing