Options
All
  • Public
  • Public/Protected
  • All
Menu

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.

Hierarchy

  • PerspectiveCamera

Implements

Index

Constructors

constructor

  • new PerspectiveCamera(fov?: number, aspect?: number, near?: number, far?: number): PerspectiveCamera
  • Parameters

    • Default value fov: number = 45 * Math.PI / 180

      The field of view.

    • Default value aspect: number = 1

      The aspect is the ratio width / height.

    • Default value near: number = 0.1

      The distance of the near plane from the camera.

    • Default value far: number = 1000

      The distance of the far plane from the camera.

    Returns PerspectiveCamera

Accessors

aspect

  • get aspect(): number
  • set aspect(aspect: number): void

eye

far

  • get far(): number
  • set far(far: number): void

fov

  • get fov(): number
  • set fov(value: number): void
  • 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

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

    Parameters

    • value: number

    Returns void

look

near

  • get near(): number
  • set near(near: number): void

projectionMatrix

projectionMatrixUniformName

  • get projectionMatrixUniformName(): string
  • set projectionMatrixUniformName(name: string): void
  • The name of the uniform mat4 variable in the vertex shader that receives the projection matrix value. The default name is uProjection.

    Returns string

  • The name of the uniform mat4 variable in the vertex shader that receives the projection matrix value. The default name is uProjection.

    Parameters

    • name: string

    Returns void

up

viewMatrix

viewMatrixUniformName

  • get viewMatrixUniformName(): string
  • set viewMatrixUniformName(name: string): void
  • The name of the uniform mat4 variable in the vertex shader that receives the view matrix value. The default name is uView.

    Returns string

  • The name of the uniform mat4 variable in the vertex shader that receives the view matrix value. The default name is uView.

    Parameters

    • name: string

    Returns void

Methods

imageToWorldCoords

  • imageToWorldCoords(imageX: number, imageY: number, imageZ: number): Geometric3
  • 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

setUniforms

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Protected property
  • Protected method
  • Static property
  • Static method

Generated using TypeDoc