Skip to main content

Class: CameraFrame

Defined in: core/CameraFrame.ts:44

CameraFrame wraps a Camera3D and exposes ManimGL-compatible Euler angle methods for both immediate use and animation (via the .animate proxy).

Constructors

Constructor

new CameraFrame(aspectRatio, options): CameraFrame

Defined in: core/CameraFrame.ts:60

Parameters

aspectRatio

number = ...

options

CameraFrameOptions = {}

Returns

CameraFrame

Properties

mobjectStub

readonly mobjectStub: Mobject

Defined in: core/CameraFrame.ts:58

A lightweight Mobject stub used as the Animation target. This lets CameraAnimation integrate with the existing Timeline / Scene.play() system which requires every Animation to have a .mobject.

Accessors

animate

Get Signature

get animate(): CameraAnimateProxy

Defined in: core/CameraFrame.ts:301

Returns a proxy that records camera state changes and produces a CameraAnimation when called with scene.play().

Usage (property, default 1s smooth): scene.play(frame.animate.incrementPhi(PI/4)) scene.play(frame.animate.setEulerAngles({ theta: PI/4, phi: PI/3 }))

Usage (method with options): scene.play(frame.animateTo({ duration: 2 }).incrementPhi(PI/4))

Returns

CameraAnimateProxy

Methods

_applyState()

_applyState(state): void

Defined in: core/CameraFrame.ts:275

Apply a full camera state.

Parameters

state

CameraFrameState

Returns

void


_snapshot()

_snapshot(): CameraFrameState

Defined in: core/CameraFrame.ts:263

Capture the current camera state.

Returns

CameraFrameState


animateTo()

animateTo(options): CameraAnimateProxy

Defined in: core/CameraFrame.ts:308

Like animate, but accepts AnimationOptions (duration, rateFunc).

Parameters

options

AnimationOptions = {}

Returns

CameraAnimateProxy


getCamera3D()

getCamera3D(): Camera3D

Defined in: core/CameraFrame.ts:89

Get the underlying Camera3D instance.

Returns

Camera3D


getCenter()

getCenter(): Vector3Tuple

Defined in: core/CameraFrame.ts:205

Get the look-at center.

Returns

Vector3Tuple


getDistance()

getDistance(): number

Defined in: core/CameraFrame.ts:181

Get the distance from the look-at target.

Returns

number


getEulerAngles()

getEulerAngles(): [number, number, number]

Defined in: core/CameraFrame.ts:103

Get the current Euler angles [theta, phi, gamma].

Returns

[number, number, number]


getFieldOfView()

getFieldOfView(): number

Defined in: core/CameraFrame.ts:193

Get the current field of view in degrees.

Returns

number


getGamma()

getGamma(): number

Defined in: core/CameraFrame.ts:158

Get the current gamma (roll) angle.

Returns

number


getPhi()

getPhi(): number

Defined in: core/CameraFrame.ts:139

Get the current phi (polar) angle.

Returns

number


getTheta()

getTheta(): number

Defined in: core/CameraFrame.ts:120

Get the current theta (azimuthal) angle.

Returns

number


getThreeCamera()

getThreeCamera(): PerspectiveCamera

Defined in: core/CameraFrame.ts:94

Get the underlying Three.js PerspectiveCamera.

Returns

PerspectiveCamera


incrementGamma()

incrementGamma(delta): this

Defined in: core/CameraFrame.ts:170

Increment the gamma (roll) angle by delta.

Parameters

delta

number

Returns

this


incrementPhi()

incrementPhi(delta): this

Defined in: core/CameraFrame.ts:151

Increment the phi (polar) angle by delta.

Parameters

delta

number

Returns

this


incrementTheta()

incrementTheta(delta): this

Defined in: core/CameraFrame.ts:132

Increment the theta (azimuthal) angle by delta.

Parameters

delta

number

Returns

this


moveTo()

moveTo(point): this

Defined in: core/CameraFrame.ts:210

Move the look-at center to a point. Camera position updates accordingly.

Parameters

point

Vector3Tuple

Returns

this


setAspectRatio()

setAspectRatio(ratio): this

Defined in: core/CameraFrame.ts:217

Set the aspect ratio of the underlying camera.

Parameters

ratio

number

Returns

this


setDistance()

setDistance(value): this

Defined in: core/CameraFrame.ts:186

Set the distance from the look-at target.

Parameters

value

number

Returns

this


setEulerAngles()

setEulerAngles(opts): this

Defined in: core/CameraFrame.ts:111

Set Euler angles (absolute). Any parameter left undefined is unchanged.

Parameters

opts
gamma?

number

phi?

number

theta?

number

Returns

this

this for chaining


setFieldOfView()

setFieldOfView(fov): this

Defined in: core/CameraFrame.ts:198

Set the field of view in degrees.

Parameters

fov

number

Returns

this


setGamma()

setGamma(value): this

Defined in: core/CameraFrame.ts:163

Set the gamma (roll) angle absolutely.

Parameters

value

number

Returns

this


setPhi()

setPhi(value): this

Defined in: core/CameraFrame.ts:144

Set the phi (polar) angle absolutely.

Parameters

value

number

Returns

this


setTheta()

setTheta(value): this

Defined in: core/CameraFrame.ts:125

Set the theta (azimuthal) angle absolutely.

Parameters

value

number

Returns

this