Skip to main content

Function: lookAtRotation()

lookAtRotation(forward, up, target): Quaternion

Defined in: src/utils/RotationUtils.ts:46

Creates a rotation such that forward (0, 0, -1) points towards the forward vector and the up direction is the normalized projection of the provided up vector onto the plane orthogonal to the target.

Parameters

forward

Readonly<THREE.Vector3>

Forward vector

up

Readonly<Vector3> = UP

Up vector

target

Quaternion = ...

Output

Returns

Quaternion