renderer.setAnimationLoop
This commit is contained in:
		
							
								
								
									
										2
									
								
								app.js
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								app.js
									
									
									
									
									
								
							| @ -779,6 +779,7 @@ const renderer = new THREE.WebGLRenderer({ | |||||||
| }) | }) | ||||||
| renderer.setSize(window.innerWidth, window.innerHeight) | renderer.setSize(window.innerWidth, window.innerHeight) | ||||||
| renderer.setClearColor(0x000000, 10) | renderer.setClearColor(0x000000, 10) | ||||||
|  | renderer.setAnimationLoop(animate) | ||||||
| document.body.appendChild(renderer.domElement) | document.body.appendChild(renderer.domElement) | ||||||
|  |  | ||||||
| const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000) | 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() | let clock = new THREE.Clock() | ||||||
|  |  | ||||||
| function animate() { | function animate() { | ||||||
|     requestAnimationFrame(animate) |  | ||||||
|  |  | ||||||
|     darkCylinder.rotation.y += GLOBAL_ROTATION |     darkCylinder.rotation.y += GLOBAL_ROTATION | ||||||
|     darkCylinderTexture.offset.y -= darkMoveForward |     darkCylinderTexture.offset.y -= darkMoveForward | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user