SceneTransforms

external object SceneTransforms(source)

Functions that do scene-dependent transforms between rendering-related coordinate systems.

See also

Functions

Link copied to clipboard
fun worldToDrawingBufferCoordinates(scene: Scene, position: Cartesian3, result: Cartesian2? = definedExternally): Cartesian2?

Transforms a position in world coordinates to drawing buffer coordinates. This may produce different results from SceneTransforms.worldToWindowCoordinates when the browser zoom is not 100%, or on high-DPI displays.

Link copied to clipboard
fun worldToWindowCoordinates(scene: Scene, position: Cartesian3, result: Cartesian2? = definedExternally): Cartesian2?

Transforms a position in world (WGS84 or alternative ellipsoid) coordinates to window coordinates. This is commonly used to place an HTML element at the same screen position as an object in the scene.