geographicToCartesian

fun geographicToCartesian(position: Position, altitudeMode: AltitudeMode, result: Vec3): Vec3

Converts a geographic Position to Cartesian coordinates according to an altitudeMode. The Cartesian coordinate system is a function of this render context's current globe and its terrain surface, depending on the altitude mode. In general, it is not safe to cache the Cartesian coordinates, as many factors contribute to the value returned, and may change from one frame to the next.

Return

the result argument, set to the computed Cartesian coordinates

Parameters

position

the specified position

altitudeMode

an altitude mode indicating how to interpret the position's altitude component

result

a pre-allocated Vec3 in which to store the computed X, Y and Z Cartesian coordinates


fun geographicToCartesian(latitude: Angle, longitude: Angle, altitude: Double, altitudeMode: AltitudeMode, result: Vec3, useEM: Boolean = false): Vec3

Converts a geographic position to Cartesian coordinates according to an altitudeMode. The Cartesian coordinate system is a function of this render context's current globe and its terrain surface, depending on the altitude mode. In general, it is not safe to cache the Cartesian coordinates, as many factors contribute to the value returned, and may change from one frame to the next.

Return

the result argument, set to the computed Cartesian coordinates

Parameters

latitude

the position's latitude

longitude

the position's longitude

altitude

the position's altitude in meters

altitudeMode

an altitude mode indicating how to interpret the position's altitude component

result

a pre-allocated Vec3 in which to store the computed X, Y and Z Cartesian coordinates

useEM

use the most detailed elevation model data instead of current terrain LoD