The [OrthographicView
] class is a subclass of View that creates a perspective view using classic "3D camera" view state parameters.
To render, OrthographicView
needs to be used together with a viewState
with the following parameters:
eye
(Number[3]
) - The eye position in world coordinates.lookAt
(Number[3]
) - The position being looked at.up
(Number[3]
) - The up direction.
For more information on using View
classes, consult the Views article.
new OrthographicView({left: 0, top: 0, width: 500, height: 500});
The OrthographicView
constructor takes the same parameters as the View superclass constructor, plus the following orthographic projection matrix arguments:
near
(Number
, optional) - Distance of near clipping plane. Default to1
.far
(Number
, optional) - Distance of far clipping plane. Default to100
.left
(Number
) - Left bound of the frustumtop
(Number
) - Top bound of the frustumright
(Number
, optional) - Right bound of the frustum. Automatically calculated if not provided.bottom
(Number
, optional) - Bottom bound of the frustum. Automatically calculated if not provided.
Inherits all Viewport methods.
- When zooming with orthographic view, the size (width and height) of the view and window are no longer the same. In such case, specify
right
andbottom
together withleft
andtop
explicitly to define the view size. - Refer to
examples/experimental/orthographic-zooming
for example.