xxxxxxxxxx
// ----------------------------------------
// Very processing intense!
// Use tool like P5Capture to render animation to mp4.
// https://github.com/tapioca24/p5.capture
// ----------------------------------------
let f = 0;
let W = 540;
setup=_=>{
createCanvas(W,W,WEBGL);
}
draw=_=>{
let P=PI/68;
background(0);
noStroke();
for(let u=0;u<TAU;u+=P){
for(let v=0;v<PI;v+=P){
push();
let r = sin(v+f/9)*200;
let U = u+f;
let Z = cos(U)*sin(v)*r;
let S = (Z)*cos(u+v+f*1.2)*9;
rotateX(U);
rotate(U);
translate(cos(v)*200, sin(Z/W)*sin(v)*Z, Z);
sphere(S/1000,12);
pop();
}
}
f+=.05
}