Skip to content

Viewer

A virtual camera in 3D world space.

Properties

pose

viewer.pose: ViewerPose, read-only

The pose of the viewer.

view

viewer.view: View, read-only

A view of the viewer (monoscopic rendering).

Methods

convertToViewerSpace

viewer.convertToViewerSpace(pose: Pose): Pose

Convert a pose from world space to viewer space.

Arguments

  • pose: Pose. A pose in world space.

Returns

The input pose converted to viewer space.

Example

const modelViewMatrix = viewer.convertToViewerSpace(pose).transform.matrix;

raycast

viewer.raycast(position: Vector2): Ray

Cast a ray from a point in the image space associated with this viewer.

Since: 0.4.0

Arguments

Returns

A ray in world space that corresponds to the given point.

forwardRay

viewer.forwardRay(): Ray

Compute a ray in the forward direction from the viewer.

Since: 0.4.0

Returns

A new ray in world space.