Opensim Terrain

At this point your simulated environment probably looks very little like Mars. In this article we'll follow the example of Drew Crow, and load in actual Martian landscape data - obtained from Nasa's MOLA mission (Mars Orbital Laser Altimeter). As usual the instructions are quite long because of the detail, but are actually quite simple.

MOLA was an instrument on the Mars Global surveyor, which used a laser to measure the surface of the planet.

OpenSim allows you to load in a "height-map" - an image where different shades of grey relate to different heights. Your image will need one pixel for every metre (so 256x256 for a basic OpenSim region). Although impressive in its detail, the MOLA data is not accurate to a metre, but it can still provide something representative of the Martian surface.

Loading Data in 3DEM

The 3DEM software is no longer in development, but can still be downloaded from a few locations, such as here and here. This software will load in the Mars surface data and convert it to a height-map image.

  1. Install 3DEM, and start it up.
  2. Choose the Mars MOLA (megt.img) file type.
  3. Now you get to choose which general region of the surface that you want to work with. Set the Topography data set to MEG 128 (the most detailed), and the projection to Lat/Lon.
3DEM - Selection of region. 3DEM - Selection of region.

3DEM doesn't actually include the data. You'll need to get that from somewhere else.

  1. When you are happy with your selected area, click the OK button.
  2. A file picker window will have opened. Look in the top-left of the window - this is the name of the file that you need. For example megt44n180hb.img.
  3. Go to the website:, and download the required file. The 128 files are near the bottom of the page. Make sure that you download the file on the Topography row, and double check the file name - they all have very similar names.
  4. Once the file has downloaded, you can select it in 3DEM to open it.

Refine Your Selection

You are now looking at genuine Martian surface data. However there is a bit too much of it. We'll filter it down to a smaller area.

  1. From the Operation menu, choose F8 Select a smaller area.
  2. Drag a box to select an area. Something about the size of one of the black squares is fine (~10 degrees x 10 degrees).
  3. Press the Enter key.
  4. Choose OK to accept the coordinates.
3DEM - Selecting a smaller area. 3DEM - Selecting a smaller area.

There is still actually too much data for our needs, but filtering out a large chunk will make it easier to work with. Now to actually create our height-map.

  1. First step is to change it to greyscale (all grey colours). From the Color Scale menu, choose Modify Scale.
  2. To change a colour, you select the appropriate button in the Terrain Colors section, and then adjust the sliders in the Color Controls section. Set the bottom colour to be black (all sliders 0), and set the top colour to be white (all sliders 255).
  3. The easiest way to create the grey scale is to go up in 20's. First button from the bottom all 20's, next button up all 40's, next button up all 60's etc.
  4. Make a note of the min and max altitudes, just in case you want to be more accurate later.
  5. Be sure to click on the Save File button once you have finished, so that they next time you can load it and save time.
3DEM - Finished greyscale colour map. 3DEM - Finished greyscale colour map.

It's very difficult to get the correct sized image from within 3DEM, so we'll just output a large image, and take a section using a drawing application.

  1. First, set the correct scale. From the Operation menu, choose F6 Resize Overhead View.
  2. Drag the slider to the centre to set the scale view to 1.00. Click on the OK button.
  3. We don't need the grid in the outputted image. From the Geo Coordinates menu, choose Lat-Lon Grid Off.
  4. From the File menu, choose Save Map Image.
  5. Keep the bitmap option, and save the image somewhere.

Final Editing of Your Height-Map

You can now open the image in your preferred image editing software, and choose a 256x256 pixel image. Instructions are included below for Photoshop and GIMP, but any package will be similar.

In both cases, you will now be able to drag around a selection box of the correct size. Once you have a selection that you like, copy that area, and paste it into a new image. You'll end up with an image similar to that shown below, but feel free to create as many as you'd like. Be sure to save it as a PNG.

Loading the Height-Map into OpenSim

Compared to creating the height-map, actually using it in OpenSim is very easy.

  1. Start OpenSim as described previously.
  2. In the OpenSim console, enter the command: terrain load D:/filename.png
Height-map applied to OpenSim Height-map applied to OpenSim

Assuming that D:/filename.png is the correct path to the height-map that you created, then that should be it. Your avatar can now walk around on terrain based on the surface of Mars. However, it still does not look like Mars. Click on the link below to continue.

Go to the next article: Looking like Mars >