Types and interfaces

Types of interfaces used in the constructors, options and functions of the 3D JS library.

AltitudeReference

About the reference for altitude:

A mesh that is add with the option altitudeReference being AltitudeReference.GROUND and an altitude of 10 will always “fly” 10 meters above the ground, regardless the terrain or the terrain exaggeration.

If the provided altitude were to be a negative number, then it would always be beneath the ground surface by this amount (in meters). This mode is convenient for any item that needs to be positions relatively to the ground: cars, buildings, lap post, etc.

On the other hand, mesh that is add with the option altitudeReference being AltitudeReference.MEAN_SEA_LEVEL and the altitude of 1000 means the item will be at an absolute altitude of 1000 meters (3280 feet) above the mean sea level. If located in a place where the terrain shows mountains higher than 1000 meters, then the mesh will be underneath the ground surface and as such not visible. This mode is more convenient for flying objects such as planes, paraglydings, etc. as those thend to measure altitude with an absolute reference.

SourceOrientation

Going from the original 3D space the mesh was created in, to the map 3D space:

Regardless of the original up axis, this plugin as well as MapTiler SDK/Maplibre GL JS only deal with 3D spaces that follow the right-hand rule.

GenericObject3DOptions

Generic options that apply to both point lights and meshes:

MeshOptions

Options for adding meshes specifically:

PointLightOptions

Options for adding a point light specifically:

ColorRepresentation

The type ColorRepresentation means the color can be a number (such as a hex notation 0xff0000, for red), a hex string (such as "#FF0000", for red), or a ThreeJS color (read more about these here).

MapTiler SDK JS 3D objects/models module.
On this page