Align background image in 3D editor

From FSDeveloper Wiki
Jump to: navigation, search

This tutorial describes how you can get a background image properly aligned in your 3D editor, like GMax. By having it aligned properly you can use it to trace aprons and taxiways or to position your objects correctly. So let's get started!

Getting the image

Ehdr background wgs84.jpg

The first step obviously is to get your background image. I can not tell you where to get them for your airport or country, there are just too many differences per county. But I can tell you what kind of background image you need.

Most import is that you get an image in geographical coordinates (latitude and longitude WGS84). This is the same requirement as for images used in resample to make photorealistic terrain scenery. So if you image is in another projection, you first need to reproject it. Most GIS applications can do this for you. Look at this tutorial if you want to use FWTools for it.

Another constraint is that you don't want a very high resolution image. If you have a 10000x10000 pixel image your 3D editor will most like not be able to work efficiently with it. So a slightly lower resolution is not that bad.

The image on the right shows an example background image for the airport Drachten in the Netherlands. You can see there are some back edges on the image, that is because I had to reproject it from the local Dutch projection to WGS84. I will use this image in the rest of the tutorial.

Calculating position

In your 3D editor you are working in flat earth coordinates, so to be able to position the image correctly we need to convert the know latitude and longitude of the borders of the image to XY coordinates in flat earth. The forumulas to do this conversion are well known. So you can do the math with a simple calculator or with Excel. In this case I will be using the ModelConverterX tool since it has a nice function build in for this.

So the first step is to know the latitude and longitude of your image. Maybe this information was provided together with the image or if it is a GeoTIFF image you can extract it using FWTools.

For the image of Drachten the coordinates are:


Top latitude: N53.1254080982383
Centre latitude: N53.1180834291591
Bottom latitude: N53.1107546132927
Left longitude: E6.10575772128518
Centre longitude: E6.12804110910755
Right longitude: E6.15031695315712

MCX coordinate converter.jpg

As you see I did not only get the latitude and longitude of the edges, but also of the centre of the image. That's because I will be using the centre as my reference point and origin in the 3D editor.

So now the next step is to calculate the XY coordinates of the top-left, top-right, bottom-left and bottom-right corner of the image. Like I mentioned before there are formulas to do so, but I will be used the Coordinate Converter tool within ModelConverterX (see image to the right).

In this tool you enter your reference point latitude and longitude, so in our case the centre of the image. And then the latitude and longitude of a second location. As a result you get the XY coordinates. So we need to repeat that for every corner. The resulting coordinates then are:


X Y
Top left: -1488.761 813.995
Top right: 1488.257 813.995
Bottom left: -1488.761 -814.445
Bottom right: 1488.257 -814.455

So now we have all information we need to go to our 3D editor.

Inserting the image

Gmax background.jpg
Gmax background textured.jpg

Now that we have all the information you can put the background image into your 3D editor. I will be using GMax in this tutorial, but it should work (almost) the same for SketchUp, FSDS or 3DS Max.

The first step is to draw a rectangle, for that you can use the plane primitive in GMax. Make sure to give it only 1 segment. Draw it roughly to the size of your image. Then you will move the four vertices of the rectangle to the positions we have calculated before. The image to the right shows the resulting plane.

Now we are almost done, the last step is to add your background image as a texture to this rectangle. Make sure that the texture is mapped so that it covers the entire rectangle. If you editor has an option to freeze the rectangle you better use it now, that will prevent that you accidentally move or edit your background image later on.

Now you are ready to start using your background image!

A word on FSX

If you are modelling for FSX there is one more thing you need to be aware of. FSX does not use the flat earth coordinates that we used the formulas of, as FS2004 does. If you look in the screenshot of the Coordinate Converter you see that below the flat earth coordinates there are also geocentric coordinates given. This is the coordinate system used by FSX, since it has a curved earth in it.

You have two options now:

  1. Continue modelling in the FS2004 coordinates and later correct for the difference. The Ground Polygon Wizard of ModelConverterX does this for example. It will assume you input is in FS2004 flat earth coordinates and it will correct for the curve of the earth.
  2. Use the geocentric coordinates as given by the Coordinate Converter to position your rectangle. If you are only modelling for FSX that should also work fine. But don't use the Ground Polygon Wizard in that case, as it assumes input in flat earth.