Skip to main content

Class: ThreeDCamera

Defined in: core/CameraExtensions.ts:255

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: core/CameraExtensions.ts:278

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: core/CameraExtensions.ts:330

Get the depth of field strength.

Returns

number

Set Signature

set depthOfField(value): void

Defined in: core/CameraExtensions.ts:338

Set the depth of field strength.

Parameters
value

number

DoF strength (0 = disabled)

Returns

void


distance

Get Signature

get distance(): number

Defined in: core/CameraExtensions.ts:308

Get the distance from look-at point.

Returns

number


focalDistance

Get Signature

get focalDistance(): number

Defined in: core/CameraExtensions.ts:315

Get the focal distance.

Returns

number

Set Signature

set focalDistance(value): void

Defined in: core/CameraExtensions.ts:323

Set the focal distance.

Parameters
value

number

New focal distance

Returns

void


fov

Get Signature

get fov(): number

Defined in: core/Camera.ts:76

Get the field of view.

Returns

number

Inherited from

Camera3D.fov


lookAtTarget

Get Signature

get lookAtTarget(): Vector3

Defined in: core/Camera.ts:69

Get the look-at target.

Returns

Vector3

Inherited from

Camera3D.lookAtTarget


phi

Get Signature

get phi(): number

Defined in: core/CameraExtensions.ts:294

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

Returns

number


position

Get Signature

get position(): Vector3

Defined in: core/Camera.ts:62

Get the camera position.

Returns

Vector3

Inherited from

Camera3D.position


theta

Get Signature

get theta(): number

Defined in: core/CameraExtensions.ts:301

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

Returns

number

Methods

animateOrbit()

animateOrbit(options): this

Defined in: core/CameraExtensions.ts:422

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: core/Camera.ts:55

Get the underlying Three.js PerspectiveCamera.

Returns

PerspectiveCamera

The PerspectiveCamera instance

Inherited from

Camera3D.getCamera


getOrbitAngles()

getOrbitAngles(): object

Defined in: core/Camera.ts:155

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: core/CameraExtensions.ts:494

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: core/CameraExtensions.ts:444

Check if an animation is in progress.

Returns

boolean


moveTo()

moveTo(position): this

Defined in: core/Camera.ts:85

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: core/CameraExtensions.ts:377

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: core/Camera.ts:120

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: core/CameraExtensions.ts:389

Set the distance from the look-at point.

Parameters

distance

number

New distance

Returns

this

this for chaining


setFov()

setFov(fov): this

Defined in: core/Camera.ts:108

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: core/Camera.ts:97

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: core/CameraExtensions.ts:361

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: core/CameraExtensions.ts:411

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: core/CameraExtensions.ts:456

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: core/CameraExtensions.ts:400

Zoom in or out by adjusting distance.

Parameters

factor

number

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

Returns

this

this for chaining