Skip to main content

flywave-mapview.topviewclipplanesevaluator._constructor_

Home > @flywave/flywave-mapview > TopViewClipPlanesEvaluator > (constructor)

TopViewClipPlanesEvaluator.(constructor)

Allows to setup near/far offsets (margins), rendered geometry elevation relative to sea level as also minimum near plane and maximum far plane distance constraints.

Signature:

constructor(maxElevation?: number, minElevation?: number, nearMin?: number, nearFarMarginRatio?: number, farMaxRatio?: number);

Parameters

Parameter

Type

Description

maxElevation

number

(Optional) defines near plane offset from the ground in the surface normal direction, positive values allows to render elevated terrain features (mountains, buildings). Defaults to Burj Khalifa building height.

minElevation

number

(Optional) defines far plane offset from the ground surface, negative values moves far plane below the ground level (use it to render depressions). Default zero - sea level.

nearMin

number

(Optional) minimum allowable near plane distance from camera, must be bigger than zero.

nearFarMarginRatio

number

(Optional) minimum distance between near and far plane, as a ratio of average near/far plane distance, it have to be significantly bigger than zero (especially if [[maxElevation]] and [[minElevation]] are equal), otherwise you may notice flickering when rendering, or even render empty scene if frustum planes are almost equal.

farMaxRatio

number

(Optional) maximum ratio between ground and far plane distance, allows to limit viewing distance at overall. Have to be bigger than 1.0. Keep in mind that this evaluator does not evaluate terrain (or building) elevation automatically, to keep such features rendered (between frustum planes) use [[minElevation]], [[maxElevation]] constraints. You may change this parameters at any time, but it requires repeating [[evaluatePlanes]] step, if your camera is moving you need to evaluate planes anyway. You may treat [[minElevation]] and [[maxElevation]] parameters as the maximum and minimum renderable elevation respectively along the surface normal, when camera is constantly looking downwards (top-down view). If you need ClipPlanesEvaluator for cameras that support tilt or yaw please use TiltViewClipPlanesEvaluator. [[nearFarMaxRatio]] does not limit far plane when spherical projection is in use, the algorithm used there estimates distance to point on tangent where line from camera touches the sphere horizon and there is no reason to clamp it.

Remarks

It is strongly recommended to set some reasonable [[nearFarMargin]] (offset) between near and far planes to avoid flickering.