Back to Filament

setProjection

docs/android/dokka/filament-android/com.google.android.filament/-camera/set-projection.md

1.75.03.6 KB
Original Source

//filament-android/com.google.android.filament/Camera/setProjection

setProjection

[main]
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

main

projectiontype of projection to use
leftdistance in world units from the camera to the left plane, at the near plane. Precondition: left != right
rightdistance in world units from the camera to the right plane, at the near plane. Precondition: left != right
bottomdistance in world units from the camera to the bottom plane, at the near plane. Precondition: bottom != top
topdistance in world units from the camera to the top plane, at the near plane. Precondition: bottom != top
neardistance 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 PERSPECTIVE or near != far for ORTHO.
fardistance in world units from the camera to the far plane. The far plane's position in view space is z = -far. Precondition: far>nearfor PERSPECTIVE or far != nearfor ORTHO.
These parameters are silently modified to meet the preconditions above.

See also

Camera.Projection

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

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

Parameters

main

fovInDegreesfull field-of-view in degrees. 0 <fovInDegrees<180
aspectaspect ratio width/height. aspect>0
neardistance 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 PERSPECTIVE or near != far for ORTHO.
fardistance in world units from the camera to the far plane. The far plane's position in view space is z = -far. Precondition: far>nearfor PERSPECTIVE or far != nearfor ORTHO.
directiondirection of the field-of-view parameter.
These parameters are silently modified to meet the preconditions above.

See also

Camera.Fov