Howto:Add shared models manually: Difference between revisions

Jump to navigation Jump to search
→‎.STG file format: Updates to be consistent with Docs/README.scenery
(→‎.STG file format: Updates to be consistent with Docs/README.scenery)
Line 74: Line 74:
Restart FG and fly to where you added the model; it should be there.
Restart FG and fly to where you added the model; it should be there.


== .STG file format ==
== STG file format ==
There is documention for the .stg files used by FlightGear in <tt>$FG_ROOT/Docs/README.scenery.  In particular, it describes the way that FlightGear searches the different scenery directories for .stg files.
There is documention for the .stg files used by FlightGear in <tt>$FG_ROOT/Docs/README.scenery</tt>Only information relevant for placing shared objects is included here.


Here is a summary.
Scenery files are loaded by default from <tt>[[$FG_ROOT]]/Scenery</tt>.  Alternate locations (a "scenery path") can be specified in <tt>[[$FG_SCENERY]]</tt> (or from the command line); the first-named directories have highest priority.  Thus, if you create a local directory for storing custom scenery you create, include it first in the scenery path.


Each line of the STG file has the following format:
Lines for shared objects in the STG file look like this:


{| class="prettytable" border="1" cellspacing="0" bordercolor="black">
{| class="prettytable" border="1" cellspacing="0" bordercolor="black">
|OBJECT_STATIC
|OBJECT_SHARED
|KSFO-maint-1-fb.ac
|Models/Misc/trigpoint.xml
|<nowiki>-122.377127</nowiki>
|<nowiki>-122.377127</nowiki>
|37.71570833
|37.71570833
Line 90: Line 90:
|-  
|-  
|Type
|Type
|Relative path
|filename path
|Longitude
|Longitude
|Latitude
|Latitude
Line 97: Line 97:
|}
|}


About Altitude. Looking at the files shipped with FG, there are some strange, to me, figures for altitude. Some are negative numbers. That seems odd, since objects are being placed on the surface. It suggests that above surface may be negative on the Z axis. COMMENT: Much more likely these are objects which are purposely sunk into the terrain to adjust their height.
The filename path is relative to <tt>$FG_ROOT</tt>. Longitude and latitude are expressed as decimal numbers (not degrees/minutes/seconds), with negative values representing west and south.  Elevation is in meters above mean sea-level.  Heading is in degrees, *counter-clockwise* from North as 0.0 (i.e. when looking from above). Note that this is opposite from headings in other places in FlightGear, which are clockwise.


I ran across a comment: 3D object need scenery to compute their height. This is why scenery must be associated with an existing land surface file (whatever you call it).
Some examples:
 
This is what a line with an XML file specifying the model looks like.
 
OBJECT_SHARED Models/MidAtl/cape-may-light.xml  -74.959970 38.933332 -93.0 0.00
 
This is what a line specifying the model file directly looks like.


  OBJECT_SHARED Models/MidAtl/cape-may-light.ac  -74.959970 38.933332 -93.0 0.00
  OBJECT_SHARED Models/MidAtl/cape-may-light.ac  -74.959970 38.933332 -93.0 0.00
A second example from the FlightGear KSFO scenery. Although taken from different STG files for the same area, you can see the mix of objects.
OBJECT_STATIC KSFO-terminal-fb.ac -122.3859635 37.61748958 3 90
  OBJECT_SHARED Models/Airport/windsock.xml -122.360843 37.613877 1 0
  OBJECT_SHARED Models/Airport/windsock.xml -122.360843 37.613877 1 0
  OBJECT_SHARED Models/Structures/vordme.xml -122.37389 37.61948 -0.404 0
  OBJECT_SHARED Models/Structures/vordme.xml -122.37389 37.61948 -0.404 0
OBJECT_STATIC KSFO-maint-1-fb.ac -122.377127 37.62647917 0.5 62
OBJECT_STATIC candlestickpark-fb.xml -122.3838418 37.71570833 1.756719854 0


[[Category:Howto|Add shared models manually]]
[[Category:Howto|Add shared models manually]]
[[Category:Scenery enhancement|Add shared models manually]]
[[Category:Scenery enhancement|Add shared models manually]]

Navigation menu