Mat4:perspective

Sets this matrix to represent a perspective projection.

This can be used with Pass:setProjection, or it can be sent to a Shader for use in GLSL.

m = Mat4:perspective(fov, aspect, near, far)

Arguments

NameTypeDefaultDescription
fovnumber The vertical field of view (in radians).
aspectnumber The horizontal aspect ratio of the projection (width / height).
nearnumber The near plane.
farnumber0 The far plane. Zero is a special value that will set an infinite far plane with a reversed Z range, which improves depth buffer precision and is the default.

Returns

NameTypeDescription
mMat4 The original matrix.

See also