Why should I add a camera to a scene, although I am already passing it to my render method? Every example I have seen in the repository adds the camera to the scene, e.g. weggl_geometries. But after removing scene.add( camera )
it still works...
camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 2000 );
camera.position.y = 400;
scene.add( camera );
renderer.render( scene, camera );
When you render without the camera added to the scene, it's automatically added. The point to have it in the scene is that in the more recent versions of the library you can add the camera as a child of another object (eventually animated) of the scene.
Here is some question answering from the Three.js developers https://github.com/mrdoob/three.js/issues/1046
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With