Interface ViewportInterface

A viewport is a sub-area of the entire rendering surface, see https://threejs.org/docs/#api/renderers/WebGLRenderer.setViewport

Hierarchy

Properties

bottom: number

Bottom edge of viewport [0..1], where 0 is bottom

camera: Camera

Camera used for rendering

height: number

Height of viewport [0..1]

left: number

Left edge of viewport [0…1], where 0 is left

name: string

Name of the viewport

width: number

Width of viewport [0..1]

Methods

  • Check if provided screen coordinate is within the viewport

    Returns

    Parameters

    • x: number

      Screen-space coordinate relative to top-left corner of viewport [px]

    • y: number

      Screen-space coordinate relative to top-left corner of viewport [px]

    Returns boolean

  • Set viewport offset and size on screen

    Parameters

    • left: number

      Left edge of viewport [0..1], where 0 is left

    • bottom: number

      Bottom edge of viewport [0..1], where 0 is bottom

    • width: number

      Width of viewport [0..1]

    • height: number

      Height of viewport [0..1]

    Returns void

Generated using TypeDoc