Phaser API Documentation

  Version: 
setPerspective(width, height, [fov], [near], [far])

Description:

Builds a new perspective projection matrix from the given values.

These are also the initial projection matrix & parameters for Mesh (and see panZ for more discussion).

See also setOrtho.

Parameters:

name type arguments Default description
width number

The width of the projection matrix. Typically the same as the Mesh and/or Renderer.

height number

The height of the projection matrix. Typically the same as the Mesh and/or Renderer.

fov number <optional> 45

The field of view, in degrees.

near number <optional> 0.01

The near value of the view.

far number <optional> 1000

The far value of the view.

Since: 3.50.0