MotionScript

@motion-script/core


@motion-script/core / PerspectiveCamera3D

Interface: PerspectiveCamera3D

Defined in: render3d/camera.ts:11

A perspective camera — converging rays, so distant things shrink. What you want unless you specifically need the flat look of an orthographic projection.

Extends Transform3D, so placement and aim use the same vocabulary as everything else: .perspective({ position: [0, 2, 6], lookAt: 0 }).

Extends

Properties

aspect?

optional aspect?: number

Defined in: render3d/camera.ts:21

Aspect ratio override. Omit to track the node's layout box, which is almost always what you want — otherwise the render is stretched.


castShadow?

optional castShadow?: boolean

Defined in: render3d/transform.ts:32

Inherited from

Transform3D.castShadow


far?

optional far?: number

Defined in: render3d/camera.ts:16


fov?

optional fov?: number

Defined in: render3d/camera.ts:14

Vertical field of view in degrees. Default 50.


key?

optional key?: string

Defined in: render3d/transform.ts:48

Explicit reconciler identity.

By default the renderer caches one live 3D object per op, keyed by the op's structural path — its group() nesting plus its index within that group. That is stable for a builder that emits the same ops in the same order every frame, which is the normal case.

Set key when your builder emits ops conditionally, so a slot's meaning shifts between frames (if (t > 2) g.box(...)). Without it, inserting an op renumbers every later slot and forces the tail of the cache to rebuild.

Inherited from

Transform3D.key


lookAt?

optional lookAt?: Vector3Input

Defined in: render3d/transform.ts:29

World-space point to orient toward, applied after position. Wins over both rotation and quaternion.

Inherited from

Transform3D.lookAt


near?

optional near?: number

Defined in: render3d/camera.ts:15


params?

optional params?: Record<string, unknown>

Defined in: render3d/geometry.ts:14

Inherited from

Passthrough3D.params


position?

optional position?: Vector3Input

Defined in: render3d/transform.ts:12

Position in the parent's local space. Default origin.

Inherited from

Transform3D.position


quaternion?

optional quaternion?: Quaternion

Defined in: render3d/transform.ts:22

Rotation as a unit quaternion. Wins over rotation — use it (with slerpQuaternion) for tumbles where Euler interpolation would gimbal.

Inherited from

Transform3D.quaternion


receiveShadow?

optional receiveShadow?: boolean

Defined in: render3d/transform.ts:33

Inherited from

Transform3D.receiveShadow


renderOrder?

optional renderOrder?: number

Defined in: render3d/transform.ts:35

Draw-order override, for tuning transparent sorting.

Inherited from

Transform3D.renderOrder


rotation?

optional rotation?: Vector3Input | Euler3

Defined in: render3d/transform.ts:17

Euler rotation in degrees, applied in order (default "XYZ"). Ignored when quaternion is set.

Inherited from

Transform3D.rotation


scale?

optional scale?: Vector3Input

Defined in: render3d/transform.ts:24

Per-axis scale; a scalar scales uniformly. Default 1.

Inherited from

Transform3D.scale


type

type: "perspective"

Defined in: render3d/camera.ts:12


visible?

optional visible?: boolean

Defined in: render3d/transform.ts:31

Hide without removing (keeps the cached object alive). Default true.

Inherited from

Transform3D.visible


zoom?

optional zoom?: number

Defined in: render3d/camera.ts:23

Zoom factor applied on top of fov.