updated fg-scenery-tutorial + I need a Photo howto!!!

Glenn McCord <[email protected]>
Newsgroups gmane.games.flightgear.terragear.devel
Message-ID <[email protected]>
Could someone please explain the photo application to me. All I've found 
about it (with any substance) is from 
http://baron.flightgear.org/pipermail/flightgear-users/2003-May/004313.html

I don't understand this:
1. Why is the file extension *.rgb? I thought rgb was a type of colour 
usage such as greyscale and CYMK.
2. "...and is divided up into the ksc.rgb[0-3][0-3].rgb.."
huh? Does that mean it's chopped into 3? how does that work?

It's a shame no one replied to his email.

As a good will gesture, I've ammended the fg-scenery-tutorial and have 
attached it to this email. It is just the html and fixes most (but 
hopefully all) of the redundencies. It also includes a section on how to 
build 1-arcsec US data. Now somene just has to approve it and upload it.

I could really do with some simple explanations/ howto on the whole 
photo scenery process which there seems to be a lack of documentation. I 
was ever able to figure it out (which I so far haven't) I'd write a 
hoeto at the drop of a hat. I'm sure there are people of laymen out 
there like myself who could do with the help.

Cheers,
Glenn

_______________________________________________
Terragear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/terragear-devel
fg-scenery-tutorial2.html (text/html, 28 KB)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>FlightGear Scenery Tutorial</title></head>


<body>
<h1>FlightGear Scenery Tutorial</h1>

<p><em>By David Megginson</em></p>

<div align="center">
<img src="fg-scenery-tutorial_files/upstate-ny.jpg" alt="[Upstate New York]" height="384" width="512">

<p><em>(Following the New York Central and I-90 along the Mohawk River
west of Albany, NY.)</em></p>
</div>

<p>This tutorial provides step-by-step instructions for building the
FlightGear w080n40 scenery tile, which includes (among other cities)
New York, Boston, Toronto, Montreal, and Ottawa.  At the end of the
process, you will have a 10x10 deg scenery area built with airports,
lakes, land-cover, roads, railroads, and rivers.</p>

<p>Why build your own scenery?  There are several reasons:</p>

<ol>
<li>You want to add data that are not in the default scenery, such
as roads or rivers.</li>
<li>You want to add a new airport or improve an existing one.</li>
<li>You want to take advantage of new features, such as runway
lighting, that have not yet trickled down into the default scenery
distribution.</li>
<li>You have a low-bandwidth connection, and would prefer to download
the GIS data once and rebuild locally rather than downloading large
scenery tiles every time they change.</li>
</ol>

<p>You can easily adapt this tutorial to build scenery anywhere in the
world.  All of the datasets mentioned here have world-wide coverage,
and will work as well for Tibet or New Guinea as they will for Central
Canada and the US Northeastern Seaboard.</p>

<p>In some cases, better (i.e. higher-resolution) datasets are
available for the United States than for the rest of the world.  This
tutorial will look at the dem-30 datasets that cover the whole world and the higher-resolution US datasets for people who want them.</p>


<div>
<h2>1. Before You Start...</h2>

<p>You must have copies of the following software packages installed
and running.  It is usually best to install the latest CVS version of
each:</p>

<ul>
<li><a href="http://www.simgear.org/">SimGear</a></li>
<li><a href="http://www.terragear.org/">TerraGear</a></li>
</ul>

<p>At the time of writing, both of these packages had further
dependencies on other libraries:</p>

<ul>
<li><a href="http://www.gzip.org/zlib/">zlib</a> (source archive
bundled with SimGear in <code>src-libs/</code>).</li>
<li><a href="http://www.equi4.com/metakit/">Metakit</a> (source
archive bundled with SimGear in <code>src-libs/</code>).</li>
<li><a href="http://www.cs.man.ac.uk/aig/staff/alan/software//index.html#gpc">gpc</a> (must be downloaded separately and installed according to the
instructions in the TerraGear <code>README.gpc</code> file).</li>
</ul>

<p>Of course, you'll also want a copy of <a href="http://www.flightgear.org/">FlightGear</a>, or what's the
point?</p>

<!-- end of "Before You Start..." -->
</div>


<div>
<h2>2. Downloading the Datasets</h2>

<p>TerraGear generates FlightGear scenery automatically from free,
publicly-available geographical datasets: you do not have to (and are
currently not able to) paint roads, rivers, and so forth by hand.</p>

<p>We will use two types of geographical datasets in this
tutorial:</p>

<ol>
<li><dfn>Raster data</dfn> for elevation points.  This data provides a
two-dimensional grid of evenly-spaced points containing ground
elevations.  TerraGear will use this data to create hills, valleys,
and rolling terrain; without it, the whole world would be at
sea-level.</li>
<li><dfn>Vector data</dfn> for polygons on the earth's surface.  This
data contains lines (such as roads and runways) or polygons (such as
towns or lakes) that will be painted as textured polygons on top of
the elevation grid; without it, the whole world would have exactly the
same surface cover.</li>
</ol>

<p>Here are the geographical data files you'll need to download:</p>

<dl><dt><strong>30-arcsec DEM</strong></dt><dd>
<p><a href="ftp://edcftp.cr.usgs.gov/pub/data/gtopo30/global/w100n90.tar.gz"><code>ftp://edcftp.cr.usgs.gov/pub/data/gtopo30/global/w100n90.tar.gz</code></a> (15MB).</p>

<p>This file contains all of the required elevation data for the
scenery chunk (and many neighbouring ones as well).</p>

<p>If you are building scenery for a different region, go to <a href="http://edcdaac.usgs.gov/gtopo30/gtopo30.html"><code>http://edcdaac.usgs.gov/gtopo30/gtopo30.html</code></a> and
click on the appropriate rectangle on the world map to get your
scenery.</p>

<p>These DEMs have approximately one point for every kilometer, so
features [ridges, hills, valleys, etc.] smaller than 1km will not
appear.  Higher-resolution DEMs for the United States are available
from <a href="http://edc.usgs.gov/geodata/"><code>http://edc.usgs.gov/geodata/</code></a>.</p>
</div>

<dl><dt><strong>3-arcsec SRTM and 1-arcsec SRTM Raster Data</strong></dt><dd>
<p>SRTM Raster Data is the mch more deatiled alternative to the DEM data. The United States is the best represented so if your out in the wilderness such as New Zealand, then you're out of luck.</p>
<p>You can download this data from <a href="http://seamless.usgs.gov/">http://seamless.usgs.gov</a> or from <a href="ftp://edcsgs9.cr.usgs.gov/pub/data/srtm/">this</a> ftp.</p>

</dd><dt><strong>Airport and Runway Data</strong></dt><dd>
<p><code>$FG_ROOT/Airports/runways.dat.gz</code></p>

<p>If you already have FlightGear installed on your computer, this
file will appear in the <code>Airports/</code> directory in your base
package, so you don't need to download anything.</p>

<p>You will have to edit this file to add new airports or modify
existing ones.  For a description of the format, see
<code>docs-mini/AptNavFAQ.FlightGear.html</code> in the FlightGear
<em>source</em> distribution (not the base package).</p>
</dd><dt><strong>vmap0</strong></dt><dd>
<p><a href="http://geoengine.nima.mil/ftpdir/archive/vpf_data/v0noa.tar.gz"><code>http://geoengine.nima.mil/ftpdir/archive/vpf_data/v0noa.tar.gz</code></a> (245MB)</p>

<p>This dataset (formerly known as the <cite>Digital Chart of the
World</cite>) contains non-airport vector data for all of North
America, including landmass (shorelines), lakes, rivers, cities,
towns, roads, railroads, rivers, landcover, and many other coverages
that we are not using yet.  After unpacking the file, you can burn it
directly onto a CD-ROM and work from that, if you prefer.  If you're
building scenery outside North America, you can download one of the
other three vmap0 CD-ROMs instead:</p>

<ul>

<li><a href="http://geoengine.nima.mil/ftpdir/archive/vpf_data/v0eur.tar.gz"><code>http://geoengine.nima.mil/ftpdir/archive/vpf_data/v0eur.tar.gz</code></a>
(Europe and North Asia, 251MB).</li>

<li><a href="http://geoengine.nima.mil/ftpdir/archive/vpf_data/v0sas.tar.gz"><code>http://geoengine.nima.mil/ftpdir/archive/vpf_data/v0sas.tar.gz</code></a>
(South Asia and Oceania, 240MB).</li>

<li><a href="http://geoengine.nima.mil/ftpdir/archive/vpf_data/v0soa.tar.gz"><code>http://geoengine.nima.mil/ftpdir/archive/vpf_data/v0soa.tar.gz</code></a>
(South America and Africa, 176MB).</li>

</ul>

<p>There is other, higher-resolution vector data available for the
United States, including the <cite>Digital Line Graphs</cite> (DLG)
from <a href="http://edc.usgs.gov/geodata/"><code>http://edc.usgs.gov/geodata/</code></a>.  The <a href="http://www.soest.hawaii.edu/wessel/gshhs/gshhs.html"><code>http://www.soest.hawaii.edu/wessel/gshhs/gshhs.html</code></a>
has much more detailed ocean coastlines than vmap0, but its inline
water bodies are highly inaccurate -- the shores of the Great Lakes,
for example, are sometimes several kilometers off, stranding airports
in the middle of the water.</p>

<p><cite>vmap1</cite>, a much higher-resolution version of vmap0, is
also available from <a href="http://geoengine.nima.mil/"><code>http://geoengine.nima.mil/</code></a> for some regions in the United
States.  Unfortunately, at the time of writing, TerraGear and
FlightGear cannot handle that level of extra detail, however tempting
it may be.</p>
</dd></dl>

<!-- end of "Downloading the Datasets" -->
</div>


<div>
<h2>3. Preparing the Datasets</h2>

<p>After following the instructions in the previous section, you
should have the following three data files downloaded onto your
computer:</p>

<ul>
<li><code>w100n90.tar.gz</code> (approx. 15MB)</li>
<li><code>default.apt.gz</code> (approx. 1MB)</li>
<li><code>v0noa.tar.gz</code> (approx. 145MB)</li>
</ul>

<p>Before you go any further, you need to create a root directory for
scenery building.  Personally, I use
<code>/usr/local/src/Scenery/</code>, but you can set things up any
way you like.  Inside your root scenery directory, create two
subdirectories, <code>./work/</code> and <code>./data/</code>:</p>

<blockquote><pre>$ cd /usr/local/src/Scenery/
$ mkdir work
$ mkdir data
</pre></blockquote>

<div>
<h3>3.1.1 Preparing the DEM Elevation Data</h3>

<p>Change into the data directory, and create a <code>dem30</code>
subdirectory to hold the DEM data, then change to the dem30
subdirectory and unpack the :</p>

<blockquote><pre>$ cd data
$ mkdir dem30
$ cd dem30
$ tar xvzf ../../w100n90.tar.gz
</pre></blockquote>

<p>You should end up something like this:</p>

<blockquote><pre>-rw-r--r--    1 david    david    57600000 Jan 21  1997 W100N90.DEM
-rw-r--r--    1 david    david         222 Jan 21  1997 W100N90.DMW
-rw-r--r--    1 david    david      114634 Jan 22  1997 W100N90.GIF
-rw-r--r--    1 david    david         327 Jan 23  1997 W100N90.HDR
-rw-r--r--    1 david    david         648 Jan 21  1997 W100N90.PRJ
-rw-r--r--    1 david    david         326 Jan 23  1997 W100N90.SCH
-rw-r--r--    1 david    david    28800000 Jan 21  1997 W100N90.SRC
-rw-r--r--    1 david    david          28 Jan 21  1997 W100N90.STX
</pre></blockquote>

<p>First, we need to convert the DEM from the current binary format to
an ASCII format that TerraGear can handle, using TerraGear's
<var>raw2ascii</var> command (we'll put the output in an
<code>ascii</code> subdirectory).  You can skip this step if you're
using the US 3arcsec DEMs, since they're already in ASCII format:</p>

<blockquote><pre>$ mkdir ascii
$ raw2ascii W100N90 ascii
</pre></blockquote>

<p>Ouch!  The command runs for a while and ends up creating 2,000
files in the <code>ascii/</code> subdirectory, using up over 200MB of
disk space; the good news is that you'll be able to delete these
soon.  In fact, you can already delete the original 57MB DEM files,
since you won't be needing them anymore (you might want to back up the
original tarball somewhere, though):</p>

<blockquote><pre>$ rm -v W100N90*
</pre></blockquote>

<p>Now, if you know for certain (<em>really</em> for certain) that
you're not going to build any scenery outside of the w080n40 chunk,
you can also delete all of the extra DEM files that you won't be
needing.  For w080n40, you need w071n40.dem to w080n49.dem
inclusive:</p>

<blockquote><pre>$ # Are you SURE you want to do this?
$ rm ascii/*n[5678]*
$ rm ascii/w06*
$ rm ascii/w070*
$ rm ascii/w08[1-9]*
$ rm ascii/w09*
$ rm ascii/w10*
</pre></blockquote>

<p>Now, instead of 2,000 files using over 200MB, we have only 100
files using a little over 10MB.  Note again that you shouldn't do this
if you're planning on building scenery for the surrounding tiles as
well.</p>

<p>OK, now it's time to chop up the DEM files into segments for
TerraGear.  Change back to the root of your scenery source tree (such
as <code>/usr/local/src/Scenery/</code>, then create a
<code>work/SRTM-30/</code> directory for the predigested DEM data to
live in. The folder used to be called DEM-30 (or DEM-3 for 3-arcsec DEM data) but the directories recognised by genapts (the aplication for building the airports) no longer includes them. A messy, but perfectly functional way of avoiding this problem is to just use a folder name that genapts will recognise. For DEM data, it may as well be SMTP-30.
<p>If you don't do this step, or keep using the older DEM-30 naming convention, the all the airports will be created at sea level and form huge holes in the scenery (which makes for interesting landings).</p>

<blockquote><pre>$ mkdir work/SRTM-30</pre></blockquote>

<p>Now, the next part is even more OS-dependent than usual.  You need
to run the command <var>demchop</var> on each of the
<code>*.dem</code> files in <code>data/dem30/ascii</code>
separately.  With the <var>bash</var> shell, I use the following
(again, from the root of the scenery source tree):</p>

<blockquote><pre>$ for file in data/dem30/ascii/*.dem; do
&gt; demchop $file work/SRTM-30
&gt; done
</pre></blockquote>

<p>After the code churns away for a couple of minutes, you should find
a <code>w080n40/</code> directory in <code>work/DEM-30/</code>,
containing 100 subdirectories named <code>w071n40</code> to
<code>w080n49</code>, using about 12MB of disk space.</p>

<p>You are now done preparing the elevation data.  To build scenery,
TerraGear needs only the files and directories under the
<code>work/SRTM-30/</code>; if you are tight for space, you can delete
all of your working files under <code>data/</code> now, before going
any further (if you have a lot of space, it doesn't hurt to keep them
around).</p>

</div>

<div>
<h3>3.1.2 Preparing high-res SRTM Elevation Data for the US</h3>
<p>This is an alternative step to 3.2.1 in order to generate higher resolution elevation data for the US and other fortunate regions. For the sake of pushing our hardware we're going to generate some 1-arcsec data so make sure you're in the FG_ROOT dir then go...</p>
<blockquote><pre>$ mkdir data/srtm-1-US
$ mkdir work/SRTM-United_States-1</pre></blockquote>

<p>We'll grab some 1-arcsec US data from <a href="ftp://edcsgs9.cr.usgs.gov/pub/data/srtm/United_States_1arcsec/1arcsec">here</a>. Notice that the chunks are a lot smaller. Just grab a few of the .hgt.zip files between w070e40 and w080n40 (they're named differently at this website) and save them to data/srtm-1-US. If you miss a piece and later fly over that spot, the scenery and airports will be there, but at sea-level.</p>

<p>The next step is similar to <i>demchop</i> but is used from chopping up .hgt.zip files instead.

<blockquote><pre>$ for i in data/srtm-1-US/N*.hgt.zip; do hgtchop 1 $i work/SRTM-United_States-1/; done</pre></blockquote>

<p>This will create a w080n40 dir inside SRTM-United_States-1.</p>

<p>The next tool we are going to use is a python script called <i>terrafit</i>. It should be located in ...Terragear/src/Prep/TerraFit/. From your FG_ROOT dir, make a symbolic link to terrfit.py by going:</p>

<blockquote><pre>$ ln -s ...Terragear/src/Prep/TerraFit/terrafit.py .</pre></blockquote>

<p>Don't forget the . at the end of the above command. Terrafit is a program designed to fine tune the elevation data. There are many options available for this program but for now we'll run it like this:</p>

<blockquote><pre>$ ./terrafit.py -m 50 -x 3000 -e 2 work/SRTM-United_States-1</pre></blockquote>

<p>

</div>

<!-- end of "Preparing the Elevation Data" -->

<div>
<h3>3.2 Preparing the Airport Data</h3>

<p>Note that you <strong>must</strong> prepare the elevation data
before your prepare the airport data, and that data
<strong>must</strong> be in a directory named <code>DEM-30</code> or
<code>DEM-3</code>; otherwise, all airports will be created at sea
level and will live in giant holes in your scenery.</p>

<p>Even if you already have a copy of <code>runways.dat.gz</code> on
your hard-drive in the FlightGear base package, it is probably a
good idea to make a separate copy for scenery building -- that way,
you can make local modifications without breaking anything in the file
you need to run FlightGear. Such modification might be adding in taxiways using <i>TaxiDraw</i>, a very easy to use program that can be downloaded <a href="http://www.nottingham.ac.uk/~eazdluf/TaxiDraw-0p1p1-src.tar.gz">here</a>.</p>

<p>From the root of your scenery source tree, change to the
<code>data/</code> directory and create a new <code>airports/</code>
subdirectory, then copy <code>runways.dat.gz</code> (or
<code>runways.dat</code>) into it:</p>

<blockquote><pre>$ cd data
$ mkdir airports
$ cp $FG_ROOT/Airports/runways.dat.gz airports
</pre></blockquote>

<p>Change to the airport directory, then create all of your airport
data with a single instance of the TerraGear <var>genapts</var>
command:</p>

<blockquote><pre>$ cd airports
$ genapts --input=runways.dat.gz --work=../../work/ --min-lon=-80 --max-lon=-70 --min-lat=40 --max-lat=50
</pre></blockquote>

<p>When the command finishes, you should see two new directories
inside <code>work/</code>: <code>AirportArea</code> and
<code>AirportObject</code>; together they take up a little less than
9MB (possibly more for filesystems with large, fixed block sizes).
That's all that's required to build the airports.</p>

<p>If you ever need to replace an airport, the easiest approach is to
delete all of the airports for that chunk and start over.  For
example, if you modified the entries for KBOS (Boston), you would
do</p>

<blockquote><pre>$ rm -rf work/AirportArea/w080n40/
$ rm -rf work/AirportObj/w080n40/
</pre></blockquote>

<p>And then repeat the above instructions.  It is possible to replace
individual files, but it gets fairly tricky and is not a good idea for
new users.</p>

<!-- end of "Preparing the Airport Data" -->
</div>


<div>
<h3>3.3. Preparing the vmap0 Data</h3>

<p>By now, you should already have unpacked the
<code>v0noa.tar.gz</code> into a directory somewhere on your hard
drive, or even burned it onto a CD-ROM.  If you have not yet done so,
then consider placing it in a <code>data/vmap0/</code> directory.
Wherever the data is, find the directory <code>vmaplv0</code>
containing the files <code>dht</code> and <code>lat</code> -- this is
your vmap0 root that you'll need to reference throughout this section.
All of the examples will use <code>/cdrom/vmaplv0/</code>, so you'll
have to substitute your own location.</p>

<p>The TerraGear <var>tgvpf</var> program extracts data from vmap0 and
places it in working directories for scenery building.  You run the
program once for each kind of data you require; depending on the
amount of data, each run can take several minutes to finish.</p>

<p>We'll start by extracting the basic landmass (i.e. everything that
isn't ocean):</p>

<p><em><strong>NOTE:</strong> This and all of the following examples
assume that you are building scenery for w080n40 from the
<code>noamer</code> (North America) vmap0 CD.  If that is not the case, substitute
<code>eurnasia</code>, <code>sasaus</code>, or <code>soamafr</code>
for <code>noamer</code> in every example (look inside the
<code>vmaplv0/</code> directory to see which one applies), and
subsitute your scenery chunk for <code>w080n40</code>.</em></p>

<blockquote><pre>$ cd work
$ tgvpf --chunk=w080n40 --work-dir=LandMass --material=Default /cdrom/vmaplv0 noamer bnd polbnda
</pre></blockquote>

<p>This command creates a <code>LandMass/</code> subdirectory
containing polygons for all non-ocean areas, to ensure that at least
some land appears even when specific land-cover is not available.</p>

<p>If you are impatient to see if this is working, you can skip ahead
to the next section now and try building the scenery -- note, though,
that you'll have only ocean, forested landmass, and airports.</p>

<p>Next, we'll add inland lakes and large rivers, to break up the
landmass a little:</p>

<blockquote><pre>$ tgvpf --chunk=w080n40 --work-dir=Lakes --material=Lake /cdrom/vmaplv0 noamer hydro inwatera
</pre></blockquote>

<p>These polygons go into a separate directory, named
<code>Lakes/</code>.  We could put all of the vmap0 polygons into the
same directory, but by separating them we're able easily to regenerate
one type without having to regenerate the others.</p>

<p>Next, we'll generate some narrower rivers and streams.  Since vmap0
uses only lines for these, we'll have to make up a standard width; for
now, 100m should do:</p>

<blockquote><pre>$ tgvpf --chunk=w080n40 --work-dir=Rivers --material=Stream --width=100 /cdrom/vmaplv0 noamer hydro watrcrsl
</pre></blockquote>

<p>This command adds polygons for cities and large towns:</p>

<blockquote><pre>$ tgvpf --chunk=w080n40 --work-dir=Cities --material=Urban /cdrom/vmaplv0 noamer pop builtupa
</pre></blockquote>

<p>vmap0 stores small towns only as points, so we'll use the default
1x1km squares for them:</p>

<blockquote><pre>$ tgvpf --chunk=w080n40 --work-dir=Towns --material=Town /cdrom/vmaplv0 noamer pop mispopp
</pre></blockquote>

<p>The next two commands add basic forests and farmland:</p>

<blockquote><pre>$ tgvpf --chunk=w080n40 --work-dir=Forest --material=MixedForestCover /cdrom/vmaplv0 noamer veg treesa
$ tgvpf --chunk=w080n40 --work-dir=Crops --material=MixedCropPastureCover /cdrom/vmaplv0 noamer veg cropa
</pre></blockquote>

<p>The final few commands use vmap0 line data to add freeways (50m
wide), regular roads (20m wide), and railroads (10m wide):</p>

<blockquote><pre>$ tgvpf --chunk=w080n40 --width=50m --work-dir=Freeways --material=Freeway --att=med:1 /cdrom/vmaplv0 noamer trans roadl
$ tgvpf --chunk=w080n40 --width=20m --work-dir=Roads --material=Road '--att=!med:1' /cdrom/vmaplv0 noamer trans roadl
$ tgvpf --chunk=w080n40 --width=10m --work-dir=Railroads --material=Railroad /cdrom/vmaplv0 noamer trans railrdl
</pre></blockquote>

<p>This is just a start.  There is actually much more information
available in vmap0, and once you're comfortable with scenery building,
you can distinguish different kinds of rivers, farmland, forests, and
so on, as well as adding new coverages like marshes, tundra, and polar
ice.  When you're ready, take a look at <a href="http://www.terragear.org/docs/vmap0/"><code>http://www.terragear.org/docs/vmap0/</code></a> for full
documentation on the <var>tgvpf</var> command, and at <a href="http://www.terragear.org/docs/vmap0/coverage.html"><code>http://www.terragear.org/docs/vmap0/coverage.html</code></a> for
details on vmap0 coverages and attributes.</p>

<p>For now, though, let's go on and build our FlightGear scenery.</p>

<!-- end of "Preparing the vmap0 Data" -->
</div>

<!-- end of "Preparing the Datasets" -->
</div>


<div>
<h2>4. Generating the Scenery</h2>

<p>After generating your working files for elevation, airports, and
scenery cover, you should have the following subdirectories in your
scenery <code>work/</code> directory:</p>

<blockquote><pre>AirportArea
AirportObj
Cities
Crops
SRTM-30 (or SRTM-United_States-1)
Forest
Freeways
Lakes
LandMass
Railroads
Rivers
Roads
Towns
</pre></blockquote>

<p>(On my system, they use about 265MB of disk space; if you use a
filesystem that has large, fixed block sizes, then the space used
might be several times higher because of all the small files.)</p>

<p>When you build your actual scenery, you can decide to include or
exclude each of these directories separately; for now, we'll use all
of them.</p>

<p>Before you start the scenery building, you will have to change to
your <code>work</code> directory and create a <code>Status/</code>
subdirectory, then touch a <code>MASTER_ON</code> file inside it:</p>

<blockquote><pre>$ cd work
$ mkdir Status
$ touch Status/MASTER_ON
</pre></blockquote>

<p>Now we're ready to build the w080n40 scenery in earnest.  We'll use
two TerraGear programs for scenery building:
<var>fgfs-tools-server</var>, which controls the overall build
process, and <var>fgfs-tools-client</var>, which does the actual tile
building.  First, from inside the working directory, start
<var>fgfs-tools-server</var>:</p>

<blockquote><pre>$ fgfs-tools-server . . w080n40
</pre></blockquote>

<p>When the program starts, it will print out some information:</p>

<blockquote><pre>Work base: .
Output base: .
Area width: 10 degrees
Area height: 10 degrees
lons = w080 lats = n40
start_lon = -80  start_lat = 40
socket is connected to port = 33933
</pre></blockquote>

<p>The last line is the important one -- you need to know what port
the server is listening on before you can start any clients (the port
will be different every time).</p>

<p>Now, in a separate terminal window, start a copy of
<var>fgfs-tools-client</var> to build the scenery tiles (for "33933",
substitute the port <var>fgfs-tools-server</var> is actually listening
on):</p>

<blockquote><pre>$ fgfs-tools-client --rude --output-dir=. --work-dir=. --port=33933 DEM-30 LandMass AirportArea AirportObj Cities Crops Forest Freeways Lakes Railroads Rivers Roads Towns
</pre></blockquote>

<p>If you are running on a multiprocessor machine, you can start
additional instances of <var>fgfs-tools-client</var> in separate
windows using the same command line; <var>fgfs-tools-server</var> will
divide up the work among them.</p>

<p>It will take a while for TerraGear to build the scenery -- possibly
an hour or two, depending on system load, processor speed, and disk
speed.  Go take a break until it's finished.</p>

<hr>

<p>OK, it's finally done.  <var>fgfs-tools-server</var> will still be
running (you have to kill it manually), but
<var>fgfs-tools-client</var> will have finished.  Inside
<code>Scenery/</code>, you should find a <code>w080n40/</code>
subdirectory containing your new scenery.  Let's give it a try, using
magic-carpet mode at KSYR (Syracuse, NY), staying in your
<code>work/</code> directory:</p>

<blockquote><pre>$ FG_SCENERY=./Scenery fgfs --fdm=magic --disable-panel --airport-id=KSYR
</pre></blockquote>

<p>Note that you will start slightly underground, but as soon as you
rise a few feet, you'll see the scenery properly.  Here's the view
from over the runway:</p>

<div align="center">
<img src="fg-scenery-tutorial_files/ksyr-runway.jpg" alt="[KSYR runway]" height="384" width="512">
</div>

<p>And here's a more interesting view a bit to the left, with
Interstate 90 running south of the airport and a river running in the
background:</p>

<div align="center">
<img src="fg-scenery-tutorial_files/ksyr-i90.jpg" alt="[KSYR I-90]" height="384" width="512">
</div>

<p>If you're seeing similar scenery, then you have succeeded.  Here
are a few other larger airports you can start at in w080n40:</p>

<ul>
<li>KJFK (New York, NY)</li>
<li>KLGA (New York, NY)</li>
<li>KEWR (Newark, NJ)</li>
<li>KBOS (Boston, MA)</li>
<li>KBUF (Buffalo, NY)</li>
<li>KROC (Rochester, NY)</li>
<li>KPIT (Pittsburg, PA)</li>
<li>CYUL (Montreal, PQ)</li>
<li>CYMX (Montreal, PQ)</li>
<li>CYQB (Quebec, PQ)</li>
<li>CYYZ (Toronto, ON)</li>
<li>CYOW (Ottawa, ON)</li>
</ul>

<!-- end of "Generating the Scenery" -->
</div>


<div>
<h2>5. Installing the Scenery</h2>

<p>You can put the scenery anywhere you want, as long as you point to
it with the <var>FG_SCENERY</var> environment variable.  By default,
FlightGear will look for the scenery in <code>$FG_ROOT/Scenery/</code>
-- if you copy the <code>w080n40</code> folder from
<code>work/Scenery/</code> directory into there, the scenery will
appear the next time you run FlightGear.</p>

<p>If you made any changes to <code>runways.dat.gz</code> and you want
FlightGear to know about them (say, for setting the starting airport
or the control-tower view), you will need to do a little extra
installation.  Make a backup copy of
<code>$FG_ROOT/Airports/runways.dat.gz</code>, then copy your modified
version in its place.  Next, you need to change to the
<code>$FG_ROOT/Airports/runways.dat.gz</code> directory, then run the
following commands from inside the compiled FlightGear source tree
(replace <code>/usr/local/src/flightgear-cvs/</code> with your own
prefix for the source tree):</p>

<blockquote><pre>$ rm -f simple.mk4
$ /usr/local/src/flightgear-cvs/src/Airports/gensimple runways.dat.gz simple.mk4
$ rm -f runways.mk4
$ /usr/local/src/flightgear-cvs/src/Airports/genrunways runways.dat.gz runways.mk4
</pre></blockquote>

<p>That's it.  Congratulations on building your first FlightGear
scenery, and don't hesitate to experiment, especially by improving and
adding airports, and by extracting more detailed information from
vmap0.</p>

<p>If you'd like to add buildings and other static objects, you can
install <a href="http://fgsd.sourceforge.net/">fgsd</a> or try working
manually from the instructions in
<code>docs/Model/fgfs-model-howto.html</code> in the FlightGear source
distribution.</p>

<p>Enjoy.</p>

<!-- end of "Installing the Scenery" -->
</div>

<hr>

<p><i>Last updated on 22/2/2004</i><br>
<address>David Megginson, [email protected]</address></p>

</body></html>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.