MARTINI stands for Mapbox’s Awesome Right-Triangulated Irregular Networks, Improved.
It’s an experimental JavaScript library for real-time #terrain mesh generation from height data. Given a (2k+1) × (2k+1) terrain grid, it generates a hierarchy of triangular meshes of varying level of detail in milliseconds. A work in progress.
See the algorithm in action and read more about how it works at ▻https://observablehq.com/@mourner/martin-real-time-rtin-terrain-mesh
To render terrain in #3D, you need a triangular mesh — a set of 3D triangles representing the surface. The easiest way to get one from height data is a uniform grid (two triangles per pixel), but that’s a lot of triangles. For fast rendering, we want to reduce this amount by adapting the mesh to the surface — using bigger triangles in relatively smooth areas, and smaller ones where there’s a lot of detail.
▻https://github.com/mapbox/martini
#map