{
const renderer = new THREE.WebGLRenderer({ antialias: true });
invalidation.then(() => renderer.dispose());
renderer.setSize(width, height);
renderer.setPixelRatio(devicePixelRatio);
while (true) {
renderer.render(scene, camera);
const x = createNumbers();
const t = Date.now() / 1000;
const a = 0.5;
const b = 0.5;
const f = (f, p) => Math.max(0, a + Math.sin(t * f + p) * b);
for (let i = 0; i < nSteps; i++) {
const j = i + nSteps;
const k = j + nSteps;
x[i] = f(frequency[i], phase[i]);
y[i] = f(frequency[j], phase[j]);
z[i] = f(frequency[k], phase[k]);
}
const xn = d3.cumsum(x);
const xnm = d3.max(xn);
const yn = d3.cumsum(y);
const ynm = d3.max(yn);
const zn = d3.cumsum(z);
const znm = d3.max(zn);
cubes.forEach((cube, index) => {
const [i, j, k] = triples[index];
cube.position.x = xn[i] / 2 / xnm;
cube.position.y = yn[j] / 2 / ynm;
cube.position.z = zn[k] / 2 / znm;
cube.scale.x = xn[i] / xnm;
cube.scale.y = yn[j] / ynm;
cube.scale.z = zn[k] / znm;
});
yield renderer.domElement;
}
}