Skip to main content

Class: ThreeDCamera

Defined in: src/core/CameraExtensions.ts:261

ThreeDCamera - Full 3D camera with spherical positioning. Provides phi/theta/distance control and depth of field support.

Extends​

Constructors​

Constructor​

new ThreeDCamera(aspectRatio, options): ThreeDCamera

Defined in: src/core/CameraExtensions.ts:284

Create a new ThreeDCamera.

Parameters​

aspectRatio​

number = ...

Width / height ratio. Defaults to 16/9.

options​

ThreeDCameraOptions = {}

Camera configuration options

Returns​

ThreeDCamera

Overrides​

Camera3D.constructor

Accessors​

depthOfField​

Get Signature​

get depthOfField(): number

Defined in: src/core/CameraExtensions.ts:336

Get the depth of field strength.

Returns​

number

Set Signature​

set depthOfField(value): void

Defined in: src/core/CameraExtensions.ts:344

Set the depth of field strength.

Parameters​
value​

number

DoF strength (0 = disabled)

Returns​

void


distance​

Get Signature​

get distance(): number

Defined in: src/core/CameraExtensions.ts:314

Get the distance from look-at point.

Returns​

number


focalDistance​

Get Signature​

get focalDistance(): number

Defined in: src/core/CameraExtensions.ts:321

Get the focal distance.

Returns​

number

Set Signature​

set focalDistance(value): void

Defined in: src/core/CameraExtensions.ts:329

Set the focal distance.

Parameters​
value​

number

New focal distance

Returns​

void


fov​

Get Signature​

get fov(): number

Defined in: src/core/Camera.ts:89

Get the field of view.

Returns​

number

Inherited from​

Camera3D.fov


lookAtTarget​

Get Signature​

get lookAtTarget(): Vector3

Defined in: src/core/Camera.ts:82

Get the look-at target.

Returns​

Vector3

Inherited from​

Camera3D.lookAtTarget


phi​

Get Signature​

get phi(): number

Defined in: src/core/CameraExtensions.ts:300

Get the phi angle (vertical, from Y axis).

Returns​

number


position​

Get Signature​

get position(): Vector3

Defined in: src/core/Camera.ts:75

Get the camera position.

Reads the live Three.js camera position so external drivers (e.g. OrbitControls, which mutate the camera directly) are reflected.

Returns​

Vector3

Inherited from​

Camera3D.position


theta​

Get Signature​

get theta(): number

Defined in: src/core/CameraExtensions.ts:307

Get the theta angle (horizontal, in XZ plane).

Returns​

number

Methods​

animateOrbit()​

animateOrbit(options): this

Defined in: src/core/CameraExtensions.ts:428

Animate spherical position changes.

Parameters​

options​

Object with optional phi, theta, distance, duration

distance?​

number

duration?​

number

phi?​

number

theta?​

number

Returns​

this

this for chaining


getCamera()​

getCamera(): PerspectiveCamera

Defined in: src/core/Camera.ts:65

Get the underlying Three.js PerspectiveCamera.

Returns​

PerspectiveCamera

The PerspectiveCamera instance

Inherited from​

Camera3D.getCamera


getOrbitAngles()​

getOrbitAngles(): object

Defined in: src/core/Camera.ts:191

Get spherical coordinates relative to the look-at point.

Returns​

object

Object with phi (polar), theta (azimuthal), and distance

distance​

distance: number

phi​

phi: number

theta​

theta: number

Inherited from​

Camera3D.getOrbitAngles


getSphericalPosition()​

getSphericalPosition(): object

Defined in: src/core/CameraExtensions.ts:500

Get the current spherical position.

Returns​

object

Object with phi, theta, and distance

distance​

distance: number

phi​

phi: number

theta​

theta: number


isAnimating()​

isAnimating(): boolean

Defined in: src/core/CameraExtensions.ts:450

Check if an animation is in progress.

Returns​

boolean


moveTo()​

moveTo(position): this

Defined in: src/core/Camera.ts:98

Move the camera to a specific position.

Parameters​

position​

[number, number, number]

Target position [x, y, z]

Returns​

this

this for chaining

Inherited from​

Camera3D.moveTo


orbit()​

orbit(deltaPhi, deltaTheta): this

Defined in: src/core/CameraExtensions.ts:383

Orbit the camera by delta angles (relative movement).

Parameters​

deltaPhi​

number

Change in phi angle

deltaTheta​

number

Change in theta angle

Returns​

this

this for chaining

Overrides​

Camera3D.orbit


setAspectRatio()​

setAspectRatio(ratio): this

Defined in: src/core/Camera.ts:133

Update the aspect ratio.

Parameters​

ratio​

number

Width / height ratio

Returns​

this

this for chaining

Inherited from​

Camera3D.setAspectRatio


setDistance()​

setDistance(distance): this

Defined in: src/core/CameraExtensions.ts:395

Set the distance from the look-at point.

Parameters​

distance​

number

New distance

Returns​

this

this for chaining


setFov()​

setFov(fov): this

Defined in: src/core/Camera.ts:121

Set the field of view.

Parameters​

fov​

number

Field of view in degrees

Returns​

this

this for chaining

Inherited from​

Camera3D.setFov


setLookAt()​

setLookAt(target): this

Defined in: src/core/Camera.ts:110

Set the look-at target.

Parameters​

target​

[number, number, number]

Target point [x, y, z]

Returns​

this

this for chaining

Inherited from​

Camera3D.setLookAt


setSphericalPosition()​

setSphericalPosition(phi, theta, distance?): this

Defined in: src/core/CameraExtensions.ts:367

Set the camera position using spherical coordinates.

Parameters​

phi​

number

Polar angle from Y axis (0 = top, PI = bottom)

theta​

number

Azimuthal angle in XZ plane

distance?​

number

Optional distance from look-at point

Returns​

this

this for chaining


setTarget()​

setTarget(target): this

Defined in: src/core/CameraExtensions.ts:417

Set the look-at target and update position.

Parameters​

target​

Vector3Tuple

Target point [x, y, z]

Returns​

this

this for chaining


update()​

update(dt): void

Defined in: src/core/CameraExtensions.ts:462

Update the camera animation. Should be called each frame with delta time.

Parameters​

dt​

number

Delta time in seconds

Returns​

void


zoomBy()​

zoomBy(factor): this

Defined in: src/core/CameraExtensions.ts:406

Zoom in or out by adjusting distance.

Parameters​

factor​

number

Zoom factor (>1 = zoom in, <1 = zoom out)

Returns​

this

this for chaining