linearly v0.32.0Docs


linearly v0.32.0 / mat4 / perspectiveZO

Function: perspectiveZO()

perspectiveZO(fovy, aspect, near, far): mat4

Generates a perspective projection matrix suitable for WebGPU with the given bounds. The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], which matches WebGPU/Vulkan/DirectX/Metal’s clip volume. Passing null/undefined/no value for far will generate infinite projection matrix.

Parameters

fovy: number

Vertical field of view in degrees

aspect: number

Aspect ratio. typically viewport width/height

near: number

Near bound of the frustum

far: null | number

Far bound of the frustum, can be null or Infinity

Returns

mat4

Defined in

src/mat4.ts:1138open in new window