]> git.mxchange.org Git - flightgear.git/blob - docs-mini/model-howto.html
Removed/depricated.
[flightgear.git] / docs-mini / model-howto.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2                "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4 <html xmlns="http://www.w3.org/1999/xhtml">
5 <head>
6 <title>Flightgear External Model Mini-HowTo</title>
7 </head>
8
9 <body bgcolor="white">
10 <h1>FlightGear External Model Mini-HowTo</h1>
11
12 <img src="model.jpg" />
13
14 <p>FlightGear now supports external views with user-defined 3D models.
15 Eventually, FlightGear will probably support a single definition file
16 that specifies a package containing a flight model, engine model,
17 panel, external 3D model, and sounds; for now, however, users must
18 specify each of these separately.</p>
19
20 <p>FlightGear uses the open-source <a
21 href="http://plib.sourceforge.net/">PLIB</a> library, which (as of
22 version 1.3.1) includes support for several 3D file formats:</p>
23
24 <ul>
25 <li>VRML</li>
26 <li>3DS</li>
27 <li>AC3D</li>
28 <li>SSG (its native format)</li>
29 <li>ASE</li>
30 <li>DXF</li>
31 <li>TRI</li>
32 <li>OBJ</li>
33 <li>MD2</li>
34 <li>MDL (<cite>Microsoft Flight Simulator</cite> format)</li>
35 </ul>
36
37 <p>(Note that some of these have restrictions; see the PLIB
38 documentation for details.)  As new formats are added to PLIB,
39 FlightGear will automatically be able to support them.</p>
40
41 <p>First, you need to find a 3D model for the aircraft you want to see
42 during an external view.  Your best bet is probably to download an
43 MSFS MDL file from one of the many flight-simulator Web sites, such as
44 <a href="http://www.flightsim.com/">www.flightsim.com</a>.  You then
45 need to install the main model file (with the appropriate extension)
46 somewhere under <code>$FG_ROOT</code>, and install any associated
47 textures in <code>$FG_ROOT/Models/Textures</code>.</p>
48
49 <blockquote>
50 <p><strong>NOTE: if your model appears untextured and you are
51 using a case-sensitive filesystem, you may need to fiddle with the
52 case of the texture file names.</strong></p>
53 </blockquote>
54
55 <p>Next, you need to set the property <code>/sim/model/path</code> to
56 the model file's name, relative to $FG_ROOT.</p>
57
58 <p>It is possible that the model may not be aligned correctly, and
59 will appear to fly too high, too low, sideways, vertically, etc.  If
60 so, you can use the additional properties described at the end of this
61 mini-howto to adjust to model so that it appears to fly
62 realistically.</p>
63
64
65 <div>
66 <h2>Example</h2>
67
68 <p>You have downloaded a zip package containing a 3D Cessna model for
69 Microsoft Flight Simulator, and you want to use that model in
70 FlightGear.  First, you unzip the package, where you find a series of
71 files, including one with the extension "<code>mdl</code>" and several
72 with extensions ending in "<code>af</code>"; you can safely ignore any
73 other files for the installation, but you should, of course, read any
74 files describing your usage rights.</p>
75
76 <p>Change to the location of <code>$FG_ROOT</code>
77 (<code>/usr/local/FlightGear</code> on my system) and copy all of the
78 <code>*af</code> texture files to <code>Models/Textures/</code>.  In
79 Unix, assuming you unzipped in /tmp/cessna</p>
80
81 <pre>
82 cp /tmp/cessna/*af Models/Textures
83 </pre>
84
85 <p>Next, copy to <code>*.mdl</code> file to any location under
86 $FG_ROOT; it's probably a good idea to put it inside
87 <code>Models/</code>.  In Unix</p>
88
89 <pre>
90 cp /tmp/cessna/*.mdl Models
91 </pre>
92
93 <p>To use the model in FlightGear, use the <var>--prop</var> option
94 with the <code>/sim/model/path</code> property:</p>
95
96 <pre>
97 fgfs --prop:/sim/model/path=Models/C172SKH.mdl
98 </pre>
99
100 <p>Press the 'v' key to switch to external view, and see how it
101 looks.</p>
102
103 <p>If the model does seem to have the correct position or orientation,
104 you can adjust it using the properties described below.  When
105 everything is correct, you can add the properties to your .fgfsrc file
106 so that you do not have to type them every time.</p>
107
108 <!-- end of "Example" -->
109 </div>
110
111
112 <div>
113 <h2>Properties</h2>
114
115 <p>These properties allow you to specify the path of the 3D model for
116 external views and to adjust the model's position and orientation so
117 that it seems to fly in the correct position.  For example, if the
118 model is pointing backwards, you can specify</p>
119
120 <pre>
121 --prop:/sim/model/h-rotation=180
122 </pre>
123
124 <p>to turn it around the right way.  If the model seems to float a
125 half meter above the ground, you can specify</p>
126
127 <pre>
128 --prop:/sim/model/z-offset=0.5
129 </pre>
130
131 <p>to lower it a bit.</p>
132
133 <table border="1">
134
135 <thead>
136 <tr>
137 <th>Property</th>
138 <th>Default</th>
139 <th>Description</th>
140 </tr>
141 </thead>
142
143 <tbody>
144 <tr>
145 <td><code>/sim/model/path</code></td>
146 <td align="center"><code>Models/Geometry/glider.ac</code></td>
147 <td>The pathname of a file containing a 3D model, relative to
148 <code>$FG_ROOT</code>.</td>
149 </tr>
150 <tr>
151 <td><code>/sim/model/x-offset</code></td>
152 <td align="center"><code>0.0</code></td>
153 <td>The backward/forward offset in meters.  Positive is backwards,
154 negative is forwards.</td>
155 </tr>
156 <tr>
157 <td><code>/sim/model/y-offset</code></td>
158 <td align="center"><code>0.0</code></td>
159 <td>The left/right offset in meters.  Positive is right, negative is
160 left.</td>
161 </tr>
162 <tr>
163 <td><code>/sim/model/z-offset</code></td>
164 <td align="center"><code>0.0</code></td>
165 <td>The up/down offset in meters.  Positive is down, negative is
166 up.</td>
167 </tr>
168 <tr>
169 <td><code>/sim/model/h-rotation</code></td>
170 <td align="center"><code>0.0</code></td>
171 <td>The heading rotation in degrees.  Positive is counter-clockwise,
172 negative is clockwise.</td>
173 </tr>
174 <tr>
175 <td><code>/sim/model/p-rotation</code></td>
176 <td align="center"><code>0.0</code></td>
177 <td>The bank rotation in degrees.  Positive is left bank, negative is
178 right bank.</td>
179 </tr>
180 <tr>
181 <td><code>/sim/model/r-rotation</code>
182 <td align="center"><code>0.0</code></td>
183 <td>The pitch rotation in degrees.  Positive is nose up, negative is
184 nose down.</td>
185 </tr>
186 </tbody>
187
188 </table>
189
190 <!-- end of "Properties" -->
191 </div>
192
193 <hr />
194
195 <address>David Megginson,
196 <a href="mailto:david@megginson.com">david@megginson.com</a>,
197 2000-11-08</address>
198
199 </body>
200 </html>