/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.js :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: edbernar 10000) { time = Date.now(); spotLight = refreshSpotLight(scene, spotLight, ball4); lightPoint = refreshLightPoint(scene, lightPoint); } // controls.update(); updateBalls(); renderer.render(scene, camera); controlBoxLeft.update(); stats.end(); } function updateBalls() { ball1.position.z = Math.sin(Date.now() * 0.001) * 2; ball2.position.x = Math.sin(Date.now() * 0.001) * 3.5; ball3.position.x = Math.sin(Date.now() * 0.001) * 3.5; ball3.position.z = Math.sin(Date.now() * 0.001) * 2; ball4.position.z = Math.sin(Date.now() * 0.001) * 2; ball4.position.x = Math.cos(Date.now() * 0.001) * 2; ball5.position.y = Math.sin(Date.now() * 0.001) * 0.5 + 0.7; } renderer.setAnimationLoop(animate) document.addEventListener("wheel", onDocumentWheel, false); function onDocumentWheel(event) { camera.position.z += event.deltaY * 0.01; }