Mat4:perspective
EditSets this matrix to represent a perspective projection.
This can be used with Pass:setProjection
, or it can be sent to a Shader
for use in GLSL.
self = Mat4:perspective(fov, aspect, near, far)
Arguments
Name | Type | Default | Description |
fov | number | The vertical field of view (in radians). | |
aspect | number | The horizontal aspect ratio of the projection (width / height). | |
near | number | The near plane. | |
far | number | 0 | The far plane. Zero is a special value that will set an infinite far plane with a reversed Z range, which improves depth buffer precision and is the default. |
Returns
Name | Type | Description |
self | Mat4 | The modified matrix. |