跳到主要内容

flywave-mapview.mapviewutils.calculatedepthfromclipdistance

Home > @flywave/flywave-mapview > MapViewUtils > calculateDepthFromClipDistance

MapViewUtils.calculateDepthFromClipDistance() function​

Warning: This API is now obsolete.

Translates a linear clip-space distance value to the actual value stored in the depth buffer. This is useful as the depth values are not stored in the depth buffer linearly, and this can lead into confusing behavior when not taken into account.

Signature:

function calculateDepthFromClipDistance(clipDistance: number, camera: THREE.Camera): number;

Parameters​

Parameter

Type

Description

clipDistance

number

Distance from the camera in clip space (range: [0, 1]).

camera

THREE.Camera

Camera applying the perspective projection.

Returns:



number