Skip to content

UWAL / PerspectiveCamera

Classes

PerspectiveCamera

Camera manager class for scenes using perspective projection.

See

Cameras / UV Mapping for reference.

Extends

Constructors

Constructor
ts
new PerspectiveCamera(
   fov?, 
   near?, 
   far?, 
   rendererAspect?): PerspectiveCamera;
Parameters
ParameterTypeDefault valueDescription
fov?number60Field of view in degrees. Typically, optimal values range from 45 to 90 degrees.
near?number1Distance to the near plane.
far?number1e3Distance to the far plane.
rendererAspect?number | RenderStage...Aspect ratio or a Renderer instance.
Returns

PerspectiveCamera

Overrides

Camera3D.constructor

Methods

UpdateProjectionMatrix()
ts
UpdateProjectionMatrix(): void;

Compute the perspective projection and write the result into the corresponding uniform buffer if present.

Returns

void

Overrides

Camera3D.UpdateProjectionMatrix

Accessors

FieldOfView
Get Signature
ts
get FieldOfView(): number;
Returns

number

Camera's field of view in degrees.

Set Signature
ts
set FieldOfView(fov): void;
Parameters
ParameterTypeDescription
fovnumberCamera's field of view in degrees.
Returns

void

AspectRatio
Get Signature
ts
get AspectRatio(): number;
Returns

number

Camera's aspect ratio. Defaults to innerWidth / innerHeight.

Set Signature
ts
set AspectRatio(rendererAspect): void;
Parameters
ParameterTypeDescription
rendererAspectnumber | RenderStageCamera's aspect ratio or a Renderer instance to extract it from.
Returns

void

Released under the MIT License.