Camera.transform¶
Summary¶
Camera.transform exposes the camera's Transform object for position, rotation, and hierarchy operations. Most camera motion workflows should update this transform directly. View and view-projection matrices are derived from its world matrix.
Syntax¶
Parameters¶
This property does not take parameters.
Returns¶
Transform - Mutable transform object controlling camera world pose.
Type Details¶
Example¶
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const camera = wgpu.createCamera.perspective({ aspect: canvas.clientWidth / canvas.clientHeight });
camera.transform.setPosition(2, 1.5, 4);
camera.transform.setRotationEuler(0, 0, 0);