Renderer · function

billboardMatrix

Face the camera on every axis, for geometry with no up of its own.

Explained in Hello world.

function billboardMatrix(out: mat4, x: number, y: number, z: number, camera: Camera, scaleX?: number, scaleY?: number): void
import { billboardMatrix } from '@driftengine/core';

Parameters

ParameterTypeDescription
outmat4
xnumber
ynumber
znumber
cameraCamera
scaleX?number
scaleY?number

In depth

Built from the camera's own basis rather than from the direction to the eye, so a row of these stays mutually parallel instead of fanning out toward the viewer — the difference is obvious the moment two are near each other at the screen edge.