BufferGeometry
Object3D
Raycaster
Camera
CubeCamera
PerspectiveCamera
OrthographicCamera
StereoCamera
Clock
Curve
CurvePath
Path
Shape
ShapePath
ArrowHelper
AxesHelper
BoxHelper
Box3Helper
CameraHelper
DirectionalLightHelper
GridHelper
PolarGridHelper
HemisphereLightHelper
PlaneHelper
PointLightHelper
SkeletonHelper
SpotLightHelper
Light
PointLight
RectAreaLight
SpotLight
DirectionalLight
HemisphereLight
LightShadow
PointLightShadow
AnimationLoader
AudioLoader
BufferGeometryLoader
CompressedTextureLoader
CubeTextureLoader
DataTextureLoader
FileLoader
ImageBitmapLoader
ImageLoader
Loader
LoaderUtils
MaterialLoader
ObjectLoader
TextureLoader
LoadingManager
Material
Box2
Box3
Color
Cylindrical
Euler
Frustum
Interpolant
Line3
MathUtils
Matrix3
Matrix4
Plane
Quaternion
AnimationAction
AnimationClip
AnimationMixer
AnimationObjectGroup
AnimationUtils
keyframeTrack
PropertyBinding
PropertyMixer
BooleanKeyframeTrack
QuaternionKeyframeTrack
StringKeyframeTrack
Audio
AudioAnalyser
AudioContext
AudioListener
PositionalAudio

CameraHelper.setColors()

The CameraHelper.setColors() method is used to set the colors of the three visible lines that represent a camera's frustum.

Syntax

cameraHelper.setColors( colorNear: number, colorFar: number )

Parameters

  • colorNear — The RGB color value to use for the near plane (default is 0xff0000).
  • colorFar — The RGB color value to use for the far plane (default is 0x00ff00).

Example

const camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 0.1, 1000 );
const cameraHelper = new THREE.CameraHelper( camera );
cameraHelper.setColors( 0xff0000, 0x00ff00 );

scene.add( cameraHelper );

This will create a camera helper and set the colors of the near and far planes to red and green respectively.

Notes

The colors must be specified as RGB color values (e.g. 0xff0000 for red) and can be provided as hexadecimal numbers.

This method only affects the visual representation of the camera helper and does not update the camera itself.

See Also