Vertex Viewer SDK
    Preparing search index...

    Class Viewport

    A Viewport represents 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.

    Implements

    Index
    center: Point.Point

    The center point of the viewport.

    height: number

    The height of the viewport.

    width: number

    The 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.

      Parameters

      • pt: Point.Point

        A point in viewport coordinates.

      • image: FrameImageLike

        An image of a frame.

      • camera: FrameCameraBase

        A camera used to determine orientation of the scene.

      Returns Ray

      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.

      Parameters

      • pt: Point.Point

        A point in viewport coordinates.

      • depthBuffer: DepthBuffer

        A depth buffer for computing the Z axis.

      • OptionalfallbackNormalizedDepth: number

        A fallback value if the depth is the max depth value, or cannot be determined.

      Returns Vector3.Vector3