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

Object3D → Line → LineSegments →

# CameraHelper

This helps with visualizing what a camera contains in its frustum. It visualizes the frustum of a camera using a LineSegments.

## Code Example

`const camera = new v3d.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); const helper = new v3d.CameraHelper(camera); app.scene.add(helper);`

## Constructor

### CameraHelper(camera : Camera)

camera — the camera to visualize.

This create a new CameraHelper for the specified camera.

## Properties

See the base LineSegments class for inherited properties.

### # .camera : Camera

The camera being visualized.

### # .pointMap : Object

This contains the points used to visualize the camera.

### # .matrix : Object

Reference to the camera.matrixWorld.

### # .matrixAutoUpdate : Object

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

## Methods

See the base LineSegments class for inherited methods.

### # .dispose()

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

### # .setColors(frustum : Color, cone : Color, up : Color, target : Color, cross : Color) → this

Defines the colors of the helper.

### # .update()

Updates the helper based on the projectionMatrix of the camera.

## Source

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