Package: graphene

Function graphene:matrix-init-frustum

Lambda List

graphene:matrix-init-frustum (matrix left right bottom top znear zfar)

Arguments

matrix -- a graphene:matrix-t instance
left -- a number for the left edge of the clipping plane
right -- a number for the right edge of the clipping plane
top -- a number for the top edge of the clipping plane
bottom -- a number for the bottom edge of the clipping plane
znear -- a number for the distance of the near clipping plane
zfar -- a number for the distance of the far clipping plane

Return Value

The initialized graphene:matrix-t instance.

Details

Initializes the matrix compatible with a frustum. The matrix is initialized with the following components:
⎛ 2*n/(r-l)     0              0              0 ⎞
⎜ 0             2*n/(t-b)      0              0 ⎟
⎜ (r+l)/(r-l)   (t+b)/(t-b)   -(f+n)/(f-n)   -1 ⎟
⎝ 0             0             -2*f*n/(f-n)    0 ⎠

l = left, r = right, b = bottom, t = top, n = znear, f = zfar

Notes

All numbers are coerced to a single float before being passed to the foreign C function.
 

See also

2024-12-30