Skip to main content

flywave-mapview.camerautils.setfocallength

Home > @flywave/flywave-mapview > CameraUtils > setFocalLength

CameraUtils.setFocalLength() function

This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Sets a camera's focal length.

Signature:

function setFocalLength(camera: THREE.PerspectiveCamera, focalLength: number, viewportHeight: number): number;

Parameters

Parameter

Type

Description

camera

THREE.PerspectiveCamera

focalLength

number

Focal length in pixels. It must be larger than 0.

viewportHeight

number

Viewport height in pixels, used to compute vertical fov.

Returns:



number

The new camera's focal length in pixels.

## Remarks

The camera's vertical fov will be updated to achieve the given viewport height.