renderer.setAnimationLoop

This commit is contained in:
Adrien MALINGREY 2023-06-23 23:54:32 +02:00
parent 107bd38d8a
commit e498459afa

2
app.js
View File

@ -779,6 +779,7 @@ const renderer = new THREE.WebGLRenderer({
})
renderer.setSize(window.innerWidth, window.innerHeight)
renderer.setClearColor(0x000000, 10)
renderer.setAnimationLoop(animate)
document.body.appendChild(renderer.domElement)
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000)
@ -924,7 +925,6 @@ window.addEventListener("resize", () => {
let clock = new THREE.Clock()
function animate() {
requestAnimationFrame(animate)
darkCylinder.rotation.y += GLOBAL_ROTATION
darkCylinderTexture.offset.y -= darkMoveForward