setProjection

open fun setProjection(projection: Camera.Projection, left: Double, right: Double, bottom: Double, top: Double, near: Double, far: Double)

Sets the projection matrix from a frustum defined by six planes.

Parameters

projection

type of projection to use

left

distance in world units from the camera to the left plane, at the near plane. Precondition: left != right

right

distance in world units from the camera to the right plane, at the near plane. Precondition: left != right

bottom

distance in world units from the camera to the bottom plane, at the near plane. Precondition: bottom != top

top

distance in world units from the camera to the top plane, at the near plane. Precondition: bottom != top

near

distance in world units from the camera to the near plane. The near plane's position in view space is z = -near. Precondition: near 0 for Projection.PERSPECTIVE or near != far for Projection.ORTHO.

far

distance in world units from the camera to the far plane. The far plane's position in view space is z = -far. Precondition: far near for Projection.PERSPECTIVE or far != near for Projection.ORTHO.

These parameters are silently modified to meet the preconditions above.

See also

Camera.Projection

open fun setProjection(fovInDegrees: Double, aspect: Double, near: Double, far: Double, direction: Camera.Fov)

Sets the projection matrix from the field-of-view.

Parameters

fovInDegrees

full field-of-view in degrees. 0 <fovInDegrees< 180

aspect

aspect ratio width/height. aspect 0

near

distance in world units from the camera to the near plane. The near plane's position in view space is z = -near. Precondition: near 0 for Projection.PERSPECTIVE or near != far for Projection.ORTHO.

far

distance in world units from the camera to the far plane. The far plane's position in view space is z = -far. Precondition: far near for Projection.PERSPECTIVE or far != near for Projection.ORTHO.

direction

direction of the field-of-view parameter.

These parameters are silently modified to meet the preconditions above.

See also

Camera.Fov