Howto:Add shared models manually: Difference between revisions

Jump to navigation Jump to search
clarified distinction between shared and static models, and between objects and models
(→‎Step 7: Added check and revise location if necessary; use command-line options to start in that location)
(clarified distinction between shared and static models, and between objects and models)
Line 1: Line 1:
You can add your own objects, known as "shared models" to FlightGear's world.  This howto explains one way to do so.  It assumes that you already have a model for the object. There are many that come standard with FG; they are stored in the <tt>[[$FG_ROOT]]/Models</tt> directory.   
You can add objects, known as "models" to FlightGear's world.  This howto explains one way to do so, especially with the shared models that are distributed with FlightGear and stored in the <tt>[[$FG_ROOT]]/Models</tt> directory.  These models are called "shared" because they are used to define many objects in different places.  (There are also "static models" which represent unique objects, such as famous buildings, that only exist in one place, but we won't have much to say about them.)


You can also create one using a suitable modeling program such as [http://www.blender.org/ blender].  The most common file format used is .ac, but you can use any format that PLIB supports, such as AC3D.
You can also create your own models using a suitable modeling program such as [http://www.blender.org/ blender].  The most common file format used is .ac, but you can use any format that PLIB supports, such as AC3D.




== Adding Shared Models to FlightGear's World ==
== Using Shared Models to Add Objects to FlightGear's World ==


=== Step 1 ===
=== Step 1 ===
If you plan to use one of the standard FG models, skip to step 4.
If you plan to use one of the standard FG shared models, skip to step 4.


If you have created your own model, create a new directory for it under <tt>[[$FG_ROOT]]/Models</tt> (to keep your models separate from the standard ones).  We'll use <tt>$FG_ROOT/Models/MyModels</tt> as an example.
If you have created your own model, create a new directory for it under <tt>[[$FG_ROOT]]/Models</tt> (to keep your models separate from the standard ones).  We'll use <tt>$FG_ROOT/Models/MyModels</tt> as an example.
Line 32: Line 32:


=== Step 4 ===
=== Step 4 ===
Next, you have to determine where to place the model in FG's world.
Next, you have to determine where to place an instance of the object in FG's world.


A useful resource at this stage are websites that allow you to get the coordinates of a point from aerial photographs.  One such is [http://itouchmap.com/ itouchmap.com], which relies on Google Maps.  Enter a street name, city, and state. When you get a good photo of your feature, click on map to place a marker there, then read the displayed coordinates.  Google Earth is also a good way to obtain position information, and there are other websites that will provide it also, or you can get it from a GPS.  (Coordinates of real-world locations are not copyrightable, so there is no legal problem with using these tools, but don't copy their other content, such as images!)
A useful resource at this stage are websites that allow you to get the coordinates of a point from aerial photographs.  One such is [http://itouchmap.com/ itouchmap.com], which relies on Google Maps.  Enter a street name, city, and state. When you get a good photo of your feature, click on map to place a marker there, then read the displayed coordinates.  Google Earth is also a good way to obtain position information, and there are other websites that will provide it also, or you can get it from a GPS.  (Coordinates of real-world locations are not copyrightable, so there is no legal problem with using these tools, but don't copy their other content, such as images!)
Line 53: Line 53:


In brief, the format is :
In brief, the format is :
  OBJECT_SHARED path longitude latitude altitude rotation
  type path longitude latitude altitude rotation


The path is relative to the $FG_ROOT directory. If you have an XML file for the model, specify it here, otherwise specify the .ac file.  Altitude is in meters above mean sea level.  Rotation is '''counter-clockwise''' from north (not clockwise as in the rest of FG).
* Most of the time you'll use OBJECT_SHARED as the type; this is for models that are used over and over again in many places, and are normally fetched from <tt>$FG_ROOT/Models</tt>.  (If you have a one-of-a-kind object, you might want to use OBJECT_STATIC instead; see an explanation of it in <tt>$FG_ROOT/Docs/README.scenery</tt>.)
* The path points to the file that contains the model, relative to the $FG_ROOT directory. If you have an XML file for the model, specify it here, otherwise specify the .ac file.   
* Latitude and longitude are in decimal degrees.
* Altitude is in meters above mean sea level.   
* Rotation is '''counter-clockwise''' from north (not clockwise as in the rest of FG).


There are more details on the .stg file format below.
There are more details on the .stg file format below.

Navigation menu