Thursday, July 09, 2020

Build Your Own 3D Terrain Models

three-geo is a neat JavaScript library which can be used to build small 3D terrain models. The library uses three.js and Mapbox's RGB-encoded Digital Elevation Model to create interactive 3D models of any location on Earth.

The demonstration geo-viewer application provides a great example of what can be achieved with three-geo and allows you to explore some of the capabilities of the library. Using this little demo viewer you can see three-geo in action and create your own 3D terrain models for any location around the globe. A drop-down menu provides quick links to a number of locations, such as Table Mountain and Mount Fuji. However you can use the provided map to view anywhere in the world in 3D.

To use the three-geo library in your own applications you will obviously need a Mapbox account to access the RGB-encoded DEM. The three-geo library requires you to enter a Mapbox account token in order to create the terrain model (and presumably to create a terrain model which includes satellite imagery).

Vladimir Agafonkin, the creator of the Leaflet mapping platform, has also created a JavaScript library for creating 3D terrain models from elevation data. MARTINI allows you to create a 3D terrain model of any location.

MARTINI builds a 3D terrain model using Right-Triangulated Irregular Networks (RTIN). Check out this MARTINI: Real-Time RTIN Terrain Mesh Observable notebook which both explains what this means and includes a demo map which shows you how RTIN works. You can zoom in an out and rotate the demo map. You can also adjust the level of precision using the slide control.

The 2D map below the 3D scene also updates in real-time when you adjust the precision of the map. This provides a great visualization of how Martini works as it shows the number of triangles being used at different levels of precision.

The DEM Net Elevation API can also help you create your very own 3D terrain models for any location on Earth. Dem Net has a fantastic tool which allows you to create your own 3D models simply by selecting an area on a map. It really is that easy.

To create a 3D model all you have to do is draw a square on an interactive map around the area that you wish to model. Within seconds DEM Net will create a 3D model of the area that you selected. You can then rotate and zoom in & out on your model directly in the browser. You can also download the model in two different formats.

DEM Net includes a number of options. These include a choice of different satellite imagery sources or map tile sources for your model. You can also adjust the height or your model - to exaggerate the elevation level - and you can also choose to generate a terrain model from a range of different elevation models.

No comments: