Creating a Scene with Basic Functionality
Learn how to create a basic Three.js scene and explore its different components.
We'll cover the following...
Creating a scene
We have learned how to create THREE.Scene
, so we already know some of the basics of Three.js. We saw that for a scene to show anything, we need four different types of objects:
Camera: This determines which part of
THREE.Scene
is rendered onscreen.Lights: These have an effect on how materials are shown and are used when creating shadow effects.
Meshes: These are the main objects that are rendered from the perspective of the camera. These objects contain the vertices and faces that make up the geometry (for example, a sphere or a cube) and contain a material, which defines what the geometry looks like.
Renderer: This uses the camera and the information in the scene to draw (render) the output on the screen.
THREE.Scene
serves as the main container for the lights and the meshes we want to render. THREE.Scene
itself doesn’t have that many options and functions.
THREE.Scene
is a structure ...