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

Camera.clone()

The Camera.clone() method creates a new camera object that is a copy of the original camera. This is useful when you need to work with multiple cameras with different settings, but you don't want to modify the original camera object.

Syntax

camera.clone();

Return value

The clone() method returns a new instance of the Camera object that is a copy of the original camera.

Example

var originalCamera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 1000);
var clonedCamera = originalCamera.clone();

// Modify the cloned camera's position
clonedCamera.position.set(0, 0, 50);

// Use the original camera for the main rendering loop
renderer.render(scene, originalCamera);

// Use the cloned camera for a secondary view
renderer.render(scene, clonedCamera);

In this example, we create an original PerspectiveCamera object and a new camera object that is a clone of the original. We then modify the new camera's position and use it to render the scene in a secondary view. The original camera remains unchanged and is used for the main rendering loop.

Remarks

The clone() method creates a deep copy of the camera object, which means that any changes made to the cloned camera will not affect the original camera, and vice versa.

This method is available for all camera types in Three.js.