Class PerspectiveCamera

The PerspectiveCamera provides projection matrix and view matrix uniforms to the current Material.

The PerspectiveCamera plays the role of a host in the Visitor pattern. The FacetVistor will normally be a Material implementation. The accepting method is called setUniforms.

const ambients: Facet[] = []

const camera = new EIGHT.PerspectiveCamera()
camera.aspect = canvas.clientWidth / canvas.clientHeight
camera.eye = Geometric3.copyVector(R3.e3)
ambients.push(camera)

scene.draw(ambients)

The camera is initially positioned at e3.

Implements

Constructors

  • Parameters

    • fov: number = ...

      The field of view.

    • aspect: number = 1

      The aspect is the ratio width / height.

    • near: number = 0.1

      The distance of the near plane from the camera.

    • far: number = 1000

      The distance of the far plane from the camera.

    Returns PerspectiveCamera

Accessors

  • get fov(): number
  • The field of view is the (planar) angle (magnitude) in the camera horizontal plane that encloses object that can be seen. Measured in radians.

    Returns number

  • set fov(value): void
  • The field of view is the angle in the camera horizontal plane that the viewport subtends at the camera. The field of view is measured in radians.

    Parameters

    • value: number

    Returns void

Methods

  • Converts from image cube coordinates to world coordinates.

    Parameters

    • imageX: number

      The x-coordinate in the image cube. -1 <= x <= +1.

    • imageY: number

      The y-coordinate in the image cube. -1 <= y <= +1.

    • imageZ: number

      The z-coordinate in the image cube. -1 <= z <= +1.

    Returns Geometric3