From X-Plane Wiki
Airport Customization Using Orthophotos and 3-D Objects
This tutorial will walk through the customization of an airport's scenery using freely available tools. It is targeted at first-time users of the scenery tools--no prior experience is required or assumed. All screenshots were taken in Windows 7, but the steps should be identical in other versions of Windows, as well as in OS X, except where noted.
Remember to save your work periodically!
Install the newest version of WED
The tool that we will be using primarily is World Editor (or WED), which was created by Laminar Research specifically for working with X-Plane scenery.
Once the file has downloaded, unzip it to an easy-to-find folder. No installation is required; to launch it, just double click WED.exe (Windows) or WED.app (OS X). Because there is no installation, we recommend placing the file in the X-Plane folder. For instance, in the image below, I'm launching WED from within a folder called "$tools" that I created in the X-Plane 9 folder (the '$' at the beginning will make it the first folder listed in the X-Plane folder for convenience).
Special considerations for Windows Vista/7 users
In Windows Vista and Windows 7, users will need to disable Aero for their mouse clicks to be where they appear to be. Unless Windows is forced to use the Basic theme, clicking in the WED window will act strangely.
To launch WED using the Basic theme, right click on WED.exe and click Properties from the menu that appears. In that window, go to the Compatibility tab and check the Disable desktop composition box (highlighted in the image below). Click Apply, and in the future, WED will always launch using the Basic theme.
Select an airport
Before we can begin, we'll need to select an airport. Regardless of what airport you are interested in customizing, be sure to search the web (and especially the X-Plane.org Downloads page to make sure someone else hasn't already created a good scenery package. There's nothing worse than spending hours on a project, only to find that there is a better free version of it already available!
For the purposes of this tutorial, we will work with Johnson County Executive Airport (KOJC) in Kansas. As you can see in the image below, the default X-Plane scenery is detailed regarding the placement of runways, but is unimpressive beyond that--a perfect candidate for basic customization!
Creating a new scenery package
We are now ready to create a new, empty scenery package in WED. Double-click on WED.exe (or WED.app on a Mac) to launch it.
When the WED window appears, click the New Scenery Package button, as seen in the image below.
Type a name for the package, then press Enter. For our example airport of Johnson County Executive, we’re going to use the name “KOJC Johnson County Executive,” as seen in the image below.
With the name entered, click Open Scenery Package. After a moment, the WED drafting window will appear.
Getting familiar with the workspace
The WED workspace is made up of four panes. Click the image below to see a labeled full-size WED window (note that the airport in the image is the finished version of KOJC).
On the far left is the library browser. Here, you can browse through the files in the X-Plane library using their virtual paths. (A full understanding of the library system is not required for our purposes here, but for further reading, see Using the Library System and The X-Plane Library System). We will talk more about this pane when we begin adding objects to our airport.
To the right of the library browser is the scenery editing pane. This includes the toolbar in the left of the pane, the pointer coordinates at the bottom, and the scenery view in the center. This pane is used to place objects and to visually modify their positions. To zoom in, either scroll up with your mouse or press the + key on your keyboard. To zoom out, scroll down or press the - key. Note that the program will zoom in toward wherever the mouse is pointing.
To the right of the scenery editing pane is the object hierarchy list and the attribute pane. The object hierarchy pane lists all the objects in a given airport, in (roughly) the order that they will be loaded in. In reality, X-Plane will load certain sets of objects together (for instance, all of the taxiways), but for most purposes, the order of objects in this pane is the order in which they will be visible in the sim. The objects at the bottom of the list will be covered by all the things above them, and objects at the top of the list will be visible above all the objects below them.
Note that in this pane, each object and each group of objects can be set to locked (and un-editable) or unlocked (and editable), and visible or invisible by clicking the appropriate icon. In the image above, all objects are unlocked and visible.
Beneath the hierarchy pane is the attribute pane. This lists all the user-modifiable attributes of whichever object is selected. For instance, in the image above, the main runway of KOJC is selected, and it has a huge number of attributes--heading, latitudes, longitudes, surface material, shoulder, etc. Click the field to modify its value.
When the WED window opens for the first time, the arrangement of the window’s panes may not be to your liking. To fix this, mouse over the bars separating each segment and drag it away. Alternatively, you can right click within the three outer panes and drag your cursor to resize that pane (doing this in the center pane will just move the view).
To finish setting up the workspace, you may want to turn on satellite imagery for the world (allowing you to roughly figure out what area you're looking at). To do this, open the View menu (from the menu bar at the top of the window) and click the Toggle Terraserver option, as seen in the image below. Note that this imagery is only available for (most of) the US and select other portions of the world.
Importing airport data
With our package created, we’ll need to import its apt.dat information. Recall that an apt.dat file contains information about the layout of an airport. Because X-Plane's full apt.dat file is huge, containing information on virtually every airport on the planet, we do not want to work with the entire file. Instead, we’re going to open the default apt.dat file, copy the portion that deals with our airport, and stick this in a new (much smaller) apt.dat file that will live in our custom scenery package.
X-Plane's default apt.dat file is located in this folder (as seen in the image below):
- X-Plane 9\Resources\default scenery\default apt dat\Earth nav data
Use your favorite text editor to open this file, but be aware that it may take awhile to load--the text file is over 60 MB. Find your airport's identifier there (using the Ctrl + F shortcut in Windows or Command + F in Mac OS). For our example, we are searching for "KOJC," as seen in the image below.
The search could take awhile, again due to the file's massive size. Once you've found your identifier, highlight all the text from the first line (which begins with a 1) to the next break (which separates this airport from the next one), as seen in the image below.
Copy this text, then create a new text file in your text editor of choice and paste it there.
The custom apt.dat file will be ready to go as soon as we add a few lines of text to it. At the very beginning of the file, add this text (as seen in the image following):
Then, at the very end of the file (immediately after the last line of text, before any blank lines), add this text:
Now do a "Save As..." in the text editor. When the dialog box appears asking where to save the file, navigate to your scenery package's folder. In the case of our example, this is the folder:
- X-Plane 9\Custom Scenery\KOJC Johnson County Executive\
There, create a new folder and name it "Earth nav data" (without the quotes, of course), as seen in the image below.
Open the "Earth nav data" folder and save the file as "apt.dat" (again, without quotes). After it saves, you can close the text editor.
With that done, we need to tell WED that we want to use our apt.dat file. In the WED window with our package open, open the File menu and click Import apt.dat. Navigate to our scenery package’s folder and select our apt.dat file.
Once WED imports the airport data, you can select the airport in the object hierarchy pane and click View --> Zoom Package to zoom instantly to your airport. You should now be able to see, at the minimum, the main runway and an airport boundary.
Selecting an overlay image
Depending on the airport you've chosen, the terrain beneath the airport may not resemble the real airport very much. We can fix this by downloading some high quality orthophotos of the area--aerial photos whose corners are mapped to exact latitude and longitude coordinates.
For scenery in the US, it's easy to obtain public domain orthophotos that may be used freely in our scenery. Outside the US, it may be more difficult--copyright on most imagery like this will prevent you from distributing the images with your scenery.
Since our example airport is in the US, we're going to download our orthophoto from a public image server, the USGS Seamless server. For instructions on how to download the images you need from this server, see the Using the USGS Seamless Server article.
From here on, we will assume that you have either downloaded orthophotos from the Seamless server, or that you have similar files from some other resource. The advantage to using the Seamless server is that the image files have their geographic coordinates embedded in the files themselves--they are GeoTIFFs.
Inserting and Tuning the Unmodified Images
The image files we downloaded from the USGS Seamless server are much too high resolution to use as-is in X-Plane (at over 80 MB a piece, it would be far too RAM-intensive to load the whole thing when the simulator needed only a little slice). However, we can import our GeoTIFFs directly into WED in order to use them as guides. To do this, click open the View menu and select the Pick Overlay Image... option, as seen in the image below.
Select the GeoTIFF files that we downloaded previously. Assuming the coordinate information in the files is correct, WED will automatically place the images where they should be.
Use the Marquee tool (the dashed box in the toolbar) to select your images, then give them a meaningful name in the hierarchy pane.
If you need to fine-tune the placement of your images, use the vertex tool (which looks like a mouse pointer in the toolbar) to highlight the corners of you images, as seen in the image below.
With a corner selected, you can use the attributes pane to tune its latitude or longitude coordinates, along with its other properties. In the image below, I'm naming the upper right corner of one image.
Alternatively, you could select your image's corners and drag them to move them. This is, for obvious reasons, not near as accurate as putting in the exact coordinates that you want for the image.
With the image's position perfected, you should be able to zoom in on the runway and see the X-Plane runway aligned (nearly) perfectly with the runway in the photo, as seen in the image below.
Next, select all your orthophotos by holding down the Ctrl key (Windows) or Command key (Mac). Open the Edit menu and select Group, as seen in the image below.
Select the new image group, open the Edit menu again, and select Move Last. This will keep our background images from covering up anything else in WED. You may also want to name the group, as in the image below.
Turning our overlays into PNGs
With our unmodified images tuned and ready to use in WED, we now need to chop them up and save them in a file format that X-Plane can use. Remember, we can use whatever images we want for the purpose of our design work in WED, but we can only save certain images for use in X-Plane.
In order to use our images in X-Plane, they must have:
- resolutions less than or equal to 2048 x 2048
- square dimensions
- powers-of-2 pixel dimensions
- file formats of either DDS, BMP (not recommended), or PNG
Taking these rules together, our images could look like the following:
|Left_Orthophoto.png||512 x 512|
|Right_Orthophoto.png||1024 x 1024|
|DDS_Orthophoto.dds||2048 x 2048|
The images in the following chart, though, could not be used in X-Plane, due to either their resolution or file format.
|Not_Power_Of_Two_Size.png||1812 x 1812|
|Not_Square.png||2048 x 1024|
|Bad_File_Format.gif||2048 x 2048|
|Too_Big.dds||4096 x 4096|
Since X-Plane cannot use the orthophotos as they are, either due to their size or their file format, we’re going to open them up in Photoshop and create smaller images from them that X-Plane can use. This means we will probably want to chop them up and save them as PNG files with resolutions of either 2048 x 2048 or 1024 x 1024 pixels.
See the article Using Photoshop to Cut Images for X-Plane Scenery for a walkthrough on using Photoshop to chop up our orthophotos.
Regardless of what tool you choose to use, we will assume that your original orthophotos are now cut up into a number of smaller, square, power-of-2 sized PNGs, which are ready to be placed in our scenery package. Move these PNGs to your scenery package's folder if you haven't already done so.
Now we need to add our PNGs to the scenery package in WED. As before, open the View menu and select Pick Overlay Image. In the dialog that appears, select your first PNG, as in the screenshot below.
Align all of the corners that the PNG image's shares with your original using the vertex tool. By default, WED will "snap" them together as you drag the PNG's corner near the original's. This means that the top left corner of the top left PNG can be perfectly aligned with the original, and the top right corner of the top right PNG, and so on. From there, getting a perfect alignment is just a matter of repeatedly making the PNG invisible (using the hierarchy pane), looking at the original orthophoto below it, and making the PNG visible again. This will allow you to visually adjust the image until there is no shift in the image when going from visible to hidden to visible again.
Repeat this process for all of the "slices" of the original overlay that you have. When you're finished, group these images together like we did with the original orthophotos and, once again, move them to the bottom of the hierarchy.
In order to make our orthophotos visible in X-Plane, select the whole group of PNGs, open the Edit menu, and click Make Overlay, as in the screenshot below.
This will create a draped polygon (.pol) file for each image, which tells X-Plane how to overlay the image on top of the default scenery.
With that done, you should be able to zoom out and see all of the orthophotos in their glory.
At this point, you can delete the original orthophotos if you have not done so already.
With the orthophotos successfully added beneath the runways, it’s time to build up the airport’s objects.
For the purpose of this tutorial, we don't want to design our objects from scratch. Instead, we will use X-Plane's built-in objects, along with the huge library of objects in the OpenSceneryX package, all of which is available for free to us. Download the OpenSceneryX package here, being sure to select both the regular download and the Developer Pack.
With OpenSceneryX installed, it should appear in the library browser after restarting WED.
Let's begin adding our objects. To draw an object, first find it in the library browser. Selecting it there will also select the Object tool from the toolbar. Right click and drag your mouse around to set the object's heading. Then, use the vertex tool to change the heading, and use the marquee tool to drag it around (click on the cross). Be sure to name the object!
Note that in many cases, your drawn objects don't have to match with the objects in the orthophoto, due to the fact that X-Plane will draw concrete pads where they would be in real life, and these pads will go on top of the orthophoto.
A facade in WED is essentially an image wrapped around a polygon at a specified height. This is used to build a simple building quickly and easily. Users specify only the shape of the building at its base, its height, and the .fac file to use.
For a walkthrough on creating facade images, see the facade creation tutorial.
To draw a building facade, select the facade tool from the toolbar (or select a .fac file from the library browser), as seen in the screenshot below.
Use the facade tool to trace the outline of the buildings in your orthophoto. After it is outlined, give the facade a name and change its height (in the attribute pane) as needed.
Exporting a scenery package
When you have finished customizing the airport, open the File menu and select Export Scenery Pack.
The new scenery will be visible the next time you load the airport in X-Plane. You can see the results of our work in the image below.
To share the scenery pack with a friend, just zip up your package folder (in the case of the example, this was the folder "KOJC Johnson County Executive"). Instruct them to unzip it into their Custom Scenery folder, and they can use it too!