The CameraHelper.setColors()
method is used to set the colors of the three visible lines that represent a camera's frustum.
cameraHelper.setColors( colorNear: number, colorFar: number )
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).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.
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.
CameraHelper
- The camera helper class.