Wolfram Language

Live Version Coming Soon Check out other examples

Make a 3D Image from an Elevation Map

From an array of elevation values, create a 3D image of terrain.


code

X

how it works

Heres a simple 2D elevation map:

In[1]:=
X

You can see what that data looks like as a contour map using ListContourPlot:

In[2]:=
X
Out[2]=

Heres the same data in three dimensions:

In[3]:=
X
Out[3]=

To turn the elevation map data into a 3D image, extract the 2D data array from the map image:

In[4]:=
X

Fill the column of voxels above each pixel with the pixel value to a height proportional to the value:

In[5]:=
X

Rearrange the 3D data so that its x, y, and z axes correspond to the original elevation map:

In[6]:=
X

Render the 3D image using geographic colors:

In[7]:=
X
Out[7]=

Package those steps as a function that can be easily applied to other elevation maps:

In[8]:=
X

Test the function on elevation data from Denver, Colorado:

In[9]:=
X
Out[9]=
In[10]:=
X
Out[10]=

Scale the elevation map to reduce height exageration

In[11]:=
X
Out[11]=