lovr.graphics.getProjection

Returns the projection for a single view.

left, right, up, down = lovr.graphics.getProjection(view)

Arguments

NameTypeDescription
viewnumberThe view index.

Returns

NameTypeDescription
leftnumberThe left field of view angle, in radians.
rightnumberThe right field of view angle, in radians.
upnumberThe top field of view angle, in radians.
downnumberThe bottom field of view angle, in radians.

matrix = lovr.graphics.getProjection(view, matrix)

Arguments

NameTypeDescription
viewnumberThe view index.
matrixMat4The matrix to fill with the projection.

Returns

NameTypeDescription
matrixMat4The original matrix.

Notes

Non-stereo rendering will only use the first view.

The projection matrices are available as the mat4 lovrProjections[2] variable in shaders. The current projection matrix is available as lovrProjection.

See also