Howto:Add shared models manually: Difference between revisions

Jump to navigation Jump to search
m
some minor corrections
m (updated link, some corrections)
m (some minor corrections)
Line 1: Line 1:
{{cleanup}}
{{cleanup}}


Note: You may include scenery objects in any format that PLIB supports. Currently, this means in addition to the 3ds models mentioned, you may use AC3D and other formats.
Note: You may include scenery objects in any format that PLIB supports. Currently, this means in addition to the 3ds models mentioned, you may use AC3D and other formats. This howto assumes that you already have a model. If not, create one using a suitable modeling program such as [http://www.blender.org/ blender].


== Adding Shared Models ==
== Adding Shared Models ==
Line 10: Line 10:


=== Step 2 ===
=== Step 2 ===
Inside the data/Models/MyModels drirectory create an xml file called foomodel.xml with the following contents :
Inside the data/Models/MyModels drirectory you may create an XML file called foomodel.xml with the following contents:


IMPORTANT: The wiki does not allow raw XML code to be displayed. It will remove it. This explains why the original XML example posted here is missing. An XML file is only necessary if you are intending to include animation. An XML file is not required to render a model at a location in FlightGear. Instead of specifying an XML file in the STG file as stated below, merely give the path to the 3d model file (such as path/to/foomodel.ac).
<?xml version="1.0"?>
<PropertyList>
  <path>MyModel.ac</path>
  <animation>
  <type>range</type>
  <min-m>0</min-m>
  <max-m>20000</max-m>
  </animation>
</PropertyList>
 
Note: An XML file is only necessary if you are intending to include animation. An XML file is not required to render a model at a location in FlightGear. Instead of specifying an XML file in the STG file as stated below, merely give the path to the 3d model file (such as path/to/foomodel.ac).


=== Step 3 ===
=== Step 3 ===
Line 26: Line 36:
In CVS there is a perl program called calc-tile.pl that works out what stg file a geodetic coordinate falls in. You can get it here if you don't feel like playing with CVS and don't have the CVS branch installed: http://cvs.flightgear.org/viewvc/source/scripts/perl/scenery/calc-tile.pl?revision=HEAD Run the perl script in a terminal window passing it the longitude and latitude that you wrote down in step 4. You'll probably have to install perl first if you run on a MS OS's. Example :
In CVS there is a perl program called calc-tile.pl that works out what stg file a geodetic coordinate falls in. You can get it here if you don't feel like playing with CVS and don't have the CVS branch installed: http://cvs.flightgear.org/viewvc/source/scripts/perl/scenery/calc-tile.pl?revision=HEAD Run the perl script in a terminal window passing it the longitude and latitude that you wrote down in step 4. You'll probably have to install perl first if you run on a MS OS's. Example :


  paul@localhost scenery?$ ./calc-tile.pl -55.5 30.3
  $ ''./calc-tile.pl -55.5 30.3''
  Longitude: -55.5
  Longitude: -55.5
  Latitude: 30.3
  Latitude: 30.3
  Tile: 2039314
  Tile: 2039314
  Path: "w060n30/w056n30/2039314.stg"
  Path: "w060n30/w056n30/2039314.stg"


=== Step 6 ===
=== Step 6 ===
Line 38: Line 48:
Add the following lines to the stg file replacing the parameters with your own :
Add the following lines to the stg file replacing the parameters with your own :
  OBJECT_SHARED Models/MyModels/foomodel.xml -55.5 30.3 1000.0 0.00  
  OBJECT_SHARED Models/MyModels/foomodel.xml -55.5 30.3 1000.0 0.00  
The format is: ''OBJECT_SHARED relative_path_to_model_xml_file LON LAT ALTITUDE_above_wgs84 ellipsoid_ROTATION''. If you have no XML file, just specify the path to your model.
The format is: ''OBJECT_SHARED relative_path_to_model_xml_file LON LAT ALTITUDE_above_wgs84 ellipsoid_ROTATION''.
Note: If you have no XML file, just specify the path to your model.


=== Step 8 ===  
=== Step 8 ===  
4

edits

Navigation menu