DriftCapture · function

lookAt

A world-to-camera for an eye looking at a target, with the world's up.

Explained in DriftCapture.

function lookAt(eye: readonly [number, number, number], target: readonly [number, number, number], up?: readonly [number, number, number]): Float64Array
import { lookAt } from '@driftengine/capture';

Parameters

ParameterTypeDescription
eyereadonly [number, number, number]
targetreadonly [number, number, number]
up?readonly [number, number, number]

In depth

The camera's axes are the ones an image has: x to the right, y downward and z forward, so row zero of a frame is the top of it. Taking y upward instead renders every scene upside down, which a test of a corner's position finds and a test of a colour does not.