Skip to main content

Matrix4x4.Perspective(number fov, number aspect, number zNear, number zFar)

Create a perspective projection matrix.

Parameters:

NameTypeDescription
fovnumberVertical field-of-view in degrees.
aspectnumberAspect ratio (width divided by height).
zNearnumberNear depth clipping plane value.
zFarnumberFar depth clipping plane value.

Returns:

typeDescription
Matrix4x4The projection matrix.

Usage

---@type number
local fov;

---@type number
local aspect;

---@type number
local zNear;

---@type number
local zFar;


local val0 = Matrix4x4:Perspective(fov, aspect, zNear, zFar)

Extra Detail

Unity Matrix4x4.Perspective