DirectionalLightHelper - Verge3D User Manual - Soft8Soft
Description: Learn how to use DirectionalLightHelper in your interactive 3D apps made with Verge3D

Object3D →

# DirectionalLightHelper

Helper object to assist with visualizing a DirectionalLight's effect on the scene. This consists of plane and a line representing the light's position and direction.

## Code Example

`const light = new v3d.DirectionalLight(0xFFFFFF); const helper = new v3d.DirectionalLightHelper(light, 5); app.scene.add(helper);`

## Constructor

### DirectionalLightHelper(light : DirectionalLight, size : Float, color : Color | Integer | String)

- light — the light to be visualized.
- size — (optional) dimensions of the plane. Default is `1`.
- color — (optional) if this is not the set the helper will take the color of the light.

## Properties

See the base Object3D class for inherited properties.

### # .lightPlane : Line

Contains the line mesh showing the location of the directional light.

### # .light : DirectionalLight

Reference to the directionalLight being visualized.

### # .matrix : Matrix4

Reference to the light's matrixWorld.

### # .matrixAutoUpdate : Boolean

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

### # .color : Color

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 Object3D class for inherited properties.

### # .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 directionalLight being visualized.

## Source

For more info on how to obtain the source code of this module see this page.