Mat4:perspective

Edit

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.

self = 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
selfMat4 The modified matrix.

See also