In this example, removing lines 44 or 46 makes the object stop rendering.
43 function animate() {
44 requestAnimationFrame( animate );
45 renderer.render( scene, camera );
46 controls.update();
47 }
Shouldn’t renderer.render( scene, camera )
render the scene even without those lines?
Mugen87
November 4, 2018, 11:32am
2
You don’t need to call controls.update()
at all. It’s sufficent to ensure that your camera looks at the scene position like so:
camera.lookAt( scene.position );
Codepen: https://codepen.io/anon/pen/PxoMdQ
And you have to call requestAnimationFrame( animate );
, otherwise you have no animation loop and render your scene just once. If you perform just a single render, you should only do this when your model has finished loading:
Codepen: https://codepen.io/anon/pen/YRzmvV
1 Like
Thanks so much for the thorough explanation. You likely just saved me many hours of troubleshooting.
1 Like