Mat4:orthographic

Sets this matrix to represent an orthographic projection, useful for 2D/isometric rendering.

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


m = Mat4:orthographic(left, right, bottom, top, near, far)

Arguments

NameTypeDescription
leftnumber The left edge of the projection.
rightnumber The right edge of the projection.
bottomnumber The bottom edge of the projection.
topnumber The top edge of the projection.
nearnumber The position of the near clipping plane.
farnumber The position of the far clipping plane.

Returns

NameTypeDescription
mMat4 The original matrix.

m = Mat4:orthographic(width, height, near, far)

Arguments

NameTypeDescription
widthnumber The width of the projection.
heightnumber The height of the projection.
nearnumber The position of the near clipping plane.
farnumber The position of the far clipping plane.

Returns

NameTypeDescription
mMat4 The original matrix.

See also