threelet = {
const threelet = new Threelet({
canvas: canvas,
});
invalidation.then(() => threelet.dispose());
threelet.setup('mod-controls', THREE.OrbitControls);
threelet.setup('mod-sky', THREE.Sky);
threelet.scene.add(createTestHemisphereLight());
threelet.scene.add(createTestDirectionalLight());
const objs = createTestObjects();
objs.forEach(obj => threelet.scene.add(obj));
threelet.update = (t, dt) => {
objs[0].rotation.x += dt;
objs[1].rotation.y += dt;
objs[2].material.emissive.r = Math.sin(4*t) > 0 ? 1 : 0;
objs[3].position.x = Math.sin(t);
objs[4].position.y = Math.cos(t);
};
return threelet;
}