Since | 17.5 |
matrix perspective(float zoom, float image_aspect, float pixel_aspect, float clip_near, float clip_far)
matrix perspective(float zoom, float image_aspect, float pixel_aspect, float clip_near, float clip_far, vector4 window)
Create a perspective projection matrix with the given parameters to project from camera space to clipping space. To make a single transform from world space to clipping space given a camera matrix and a projection matrix, you would use, worldToClip = worldToCamera * projection;
zoom
The zoom for the lens. Sometimes the zoom is expressed in terms of focal and aperture. In this case, zoom = focal/aperture
.
The aspect ratio of the image. Sometimes the image_aspect is expressed in terms of xres
and yres
. In this case, image_aspect = xres / yres
.
The near clipping plane.
The far clipping plane.
The offset for the projection window encoded in a vector4. window.x and window.y are the window min xy coordinates and window.z, window.w are the window max xy coordinates. This argument is optional and defaults to {0,0,1,1} when not given.
See also | |
transform |