Skip to main content

Matrix4x4.Ortho(number left, number right, number bottom, number top, number zNear, number zFar)

Create an orthogonal projection matrix.

Parameters:

NameTypeDescription
leftnumberLeft-side x-coordinate.
rightnumberRight-side x-coordinate.
bottomnumberBottom y-coordinate.
topnumberTop y-coordinate.
zNearnumberNear depth clipping plane value.
zFarnumberFar depth clipping plane value.

Returns:

typeDescription
Matrix4x4The projection matrix.

Usage

---@type number
local left;

---@type number
local right;

---@type number
local bottom;

---@type number
local top;

---@type number
local zNear;

---@type number
local zFar;


local val0 = Matrix4x4:Ortho(left, right, bottom, top, zNear, zFar)

Extra Detail

The returned matrix, when used as a Camera's projection matrix, creates a projection of the area between left, right, top and bottom, with zNear and zFar as the near and far depth clipping planes into a cube going from (left, bottom, near) = (-1, -1, -1) to (right, top, far) = (1, 1, 1).