Creating a scene
In the previous chapter, you created THREE.Scene
, so you already know the basics of Three.js. We saw that for a scene to show anything, we need three types of components:
Component |
Description |
---|---|
Camera |
This determines what is rendered on the screen. |
Lights |
These have an effect on how materials are shown and used when creating shadow effects (discussed in detail in Chapter 3, Working with the Different Light Sources Available in Three.js). |
Objects |
These are the main objects that are rendered from the perspective of the camera: cubes, spheres, and the like. |
THREE.Scene
serves as the container for all these different objects. This object itself doesn't have that many options and functions.
Note
THREE.Scene
is a structure that is sometimes also called a scene graph. A scene graph is a structure that can hold all necessary information of a graphical scene. In Three.js, this means that THREE.Scene
contains all the objects, lights, and other objects necessary for rendering...