Skip to main content

Object3DMesh

PointLightHelper

This displays a helper object consisting of a spherical Mesh for visualizing a PointLight.

Code Example

const pointLight = new THREE.PointLight( 0xff0000, 1, 100 );
pointLight.position.set( 10, 10, 10 ); scene.add( pointLight ); const
sphereSize = 1; const pointLightHelper = new THREE.PointLightHelper(
pointLight, sphereSize ); scene.add( pointLightHelper );

Examples

[example:webgl_helpers WebGL / helpers]

Constructor

PointLightHelper

function PointLightHelper( light: PointLight, sphereSize: Float, color: Hex ):
void;

light -- The light to be visualized.

sphereSize -- (optional) The size of the sphere helper. Default is 1.

color -- (optional) if this is not the set the helper will take the color of the light.

Properties

See the base Mesh class for common properties.

light

light: PointLight;  

The PointLight that is being visualized.

matrix

matrix: Object;  

Reference to the pointLight's matrixWorld.

matrixAutoUpdate

matrixAutoUpdate: Object;  

See Object3D.matrixAutoUpdate. Set to false here as the helper is using the pointLight's matrixWorld.

color

color: hex;  

The color parameter passed in the constructor. Default is undefined. If this is changed, the helper's color will update the next time .update is called.

Methods

See the base Mesh class for common methods.

dispose

function dispose( ): undefined;  

Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.

update

function update( ): undefined;  

Updates the helper to match the position of the .light.

Source

src/helpers/PointLightHelper.js