Capítulo 114 de 859

Chapter 114: HemisphereLightHelper

Core Idea

Creates a visual aid consisting of a spherical mesh for a given HemisphereLight.

When the hemisphere light is transformed or its light properties are changed, it's necessary to call the update() method of the respective helper.

Key Concepts

  • color : number | Color | string: The color parameter passed in the constructor. If not set, the helper will take the color of the light.
  • light : HemisphereLight: The light being visualized.

Code Examples

const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );
const helper = new THREE.HemisphereLightHelper( light, 5 );
scene.add( helper );
  • What it demonstrates: Typical usage of HemisphereLightHelper.

Reference Tables

Constructor

Signature
`new HemisphereLightHelper( light : HemisphereLight, size : number, color : number

Properties

PropertyDescription
`.color : numberColor
.light : HemisphereLightThe light being visualized.

Methods

MethodDescription
.dispose()Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
.update()Updates the helper to match the position and direction of the light being visualized.

Key Takeaways

  1. HemisphereLightHelper extends: EventDispatcher → Object3D
  2. Most relevant properties: color, light.
  3. Key methods: dispose, update.

Connects To