Mat4:perspective

Sets this matrix to represent a perspective projection.

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

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

Arguments

NameTypeDescription
nearnumberThe near plane.
farnumberThe far plane.
fovnumberThe field of view (in radians).
aspectnumberThe vertical aspect ratio of the projection.

Returns

NameTypeDescription
mMat4The original matrix.

See also