The width of the viewport.
The height of the viewport.
ReadonlycenterThe center point of the viewport.
ReadonlyheightThe height of the viewport.
ReadonlywidthThe width of the viewport.
Transforms a point in viewport coordinates to a ray.
For perspective cameras, the returned ray will have an origin that is at the position of the camera with a direction that is pointing into world space away from the camera.
For orthographic cameras, the returned ray will have an origin that is at the world point of viewport coordinate with a direction that is pointing into world space away from the camera.
A point in viewport coordinates.
An image of a frame.
A camera used to determine orientation of the scene.
A ray
Transforms a point in viewport coordinates to a point in world space coordinates. This method expects a depth buffer in order to compute a value for the Z axis.
A point in viewport coordinates.
A depth buffer for computing the Z axis.
OptionalfallbackNormalizedDepth: numberA fallback value if the depth is the max depth value, or cannot be determined.
StaticfromReturns a new viewport with the given dimensions.
The dimensions of the viewport
A new viewport.
A
Viewportrepresents the drawing area in the viewer.When a frame is received from the rendering pipeline, it might not be the same dimensions of the viewport because of an interactive frame or because of bandwidth limitations or other performance reasons.
The viewport contains methods to scale an image to the viewport, as well as translate 2D coordinates between the viewport and the frame.