Capítulo 12 de 859

Chapter 12: Scene

Core Idea

Scenes allow you to set up what is to be rendered and where by three.js. This is where you place 3D objects like meshes, lines or lights.

Key Concepts

  • background : Color | Texture: Defines the background of the scene. Valid inputs are:
  • backgroundBlurriness : number: Sets the blurriness of the background. Only influences environment maps assigned to Scene#background. Valid input …
  • backgroundIntensity : number: Attenuates the color of the background. Only applies to background textures.
  • backgroundRotation : Euler: The rotation of the background in radians. Only influences environment maps assigned to Scene#background.
  • environment : Texture: Sets the environment map for all physical materials in the scene. However, it's not possible to overwrite an existing texture assigned to t…
  • environmentIntensity : number: Attenuates the color of the environment. Only influences environment maps assigned to Scene#environment.
  • environmentRotation : Euler: The rotation of the environment map in radians. Only influences physical materials in the scene when [Scene#environment](Scene.html#environ…
  • fog : Fog | FogExp2: A fog instance defining the type of fog that affects everything rendered in the scene.
  • isScene : boolean (readonly): This flag can be used for type testing.
  • overrideMaterial : Material: Forces everything in the scene to be rendered with the defined material. It is possible to exclude materials from override by setting [Mate…

Reference Tables

Constructor

Signature
new Scene()

Properties

PropertyDescription
`.background : ColorTexture`
.backgroundBlurriness : numberSets the blurriness of the background. Only influences environment maps assigned to Scene#background. Valid input is a float between 0 and 1.
.backgroundIntensity : numberAttenuates the color of the background. Only applies to background textures.
.backgroundRotation : EulerThe rotation of the background in radians. Only influences environment maps assigned to Scene#background.
.environment : TextureSets the environment map for all physical materials in the scene. However, it's not possible to overwrite an existing texture assigned to the envMap material property.
.environmentIntensity : numberAttenuates the color of the environment. Only influences environment maps assigned to Scene#environment.
.environmentRotation : EulerThe rotation of the environment map in radians. Only influences physical materials in the scene when Scene#environment is used.
`.fog : FogFogExp2`
.isScene : boolean (readonly)This flag can be used for type testing.
.overrideMaterial : MaterialForces everything in the scene to be rendered with the defined material. It is possible to exclude materials from override by setting Material#allowOverride to false.

Key Takeaways

  1. Scene extends: EventDispatcher → Object3D
  2. Most relevant properties: background, backgroundBlurriness, backgroundIntensity, backgroundRotation.

Connects To