How'd we do it?
The Mars Global Surveyor spacecraft has several
instruments on it. Two are imagers that take pictures
of the planet. Another is MOLA: the Mars Orbiting
Laser Altimeter. MOLA bounces a laser off Mars and
records the time it takes to return to the spacecraft.
From that it can calculate its distance to the planet
to within a bit over a foot. MOLA does this over
and over, methodically mapping out the surface of
the planet.
The MOLA science team has used that data to create
an elevation map of Mars. And that can be used to
create a 3D mesh of the planet. Images from the
orbiting cameras are then draped over that mesh
to create a 3D world.