Howto:3D Aircraft Models: Difference between revisions

m
Robot: Cosmetic changes
m (→‎Animating the Model: + main article)
m (Robot: Cosmetic changes)
Line 10: Line 10:
* roll is a rotation around the x-axis, where positive is clockwise viewed from behind  
* roll is a rotation around the x-axis, where positive is clockwise viewed from behind  


[[Image:heading.jpg|200px]][[Image:pitch.jpg|200px]][[Image:roll.jpg|200px]]
[[File:heading.jpg|200px]][[File:pitch.jpg|200px]][[File:roll.jpg|200px]]


[[File:Heading_Roll_Pitch_3D.jpg|400px]]
[[File:Heading_Roll_Pitch_3D.jpg|400px]]


==Loading the model==
== Loading the model ==
Through [http://www.openscenegraph.org/projects/osg OpenSceneGraph], FlightGear supports many different 3D file formats, including VRML1, AC3D, DXF, and [http://www.openscenegraph.org/osgwiki/pmwiki.php/UserGuides/Plugins many others.] However, [http://local.wasp.uwa.edu.au/~pbourke/dataformats/ac3d/ .ac] is the standard used in most FG models.  
Through [http://www.openscenegraph.org/projects/osg OpenSceneGraph], FlightGear supports many different 3D file formats, including VRML1, AC3D, DXF, and [http://www.openscenegraph.org/osgwiki/pmwiki.php/UserGuides/Plugins many others.] However, [http://local.wasp.uwa.edu.au/~pbourke/dataformats/ac3d/ .ac] is the standard used in most FG models.  


The property /sim/model/path in the main FlightGear property tree controls what model will be loaded; it takes a string value giving the relative path of the model from [[$FG_ROOT]].
The property /sim/model/path in the main FlightGear property tree controls what model will be loaded; it takes a string value giving the relative path of the model from [[$FG ROOT]].


The easiest way to load a new model is to set the property at startup with the --prop: [[Command Line Parameters|command line option]]; for example, to use a 3D aircraft model that you have installed in <tt>$FG_ROOT/Models/my-cessna.ac</tt>, you could invoke FlightGear like this (under Unix-like systems):
The easiest way to load a new model is to set the property at startup with the --prop: [[Command Line Parameters|command line option]]; for example, to use a 3D aircraft model that you have installed in <tt>$FG_ROOT/Models/my-cessna.ac</tt>, you could invoke FlightGear like this (under Unix-like systems):
Line 61: Line 61:
  </PropertyList>
  </PropertyList>


==Repositioning the Model==
== Repositioning the Model ==
Often, an aircraft model not designed specifically for FlightGear will not be positioned or oriented correctly; for example, it might be too far off the ground, and the nose might point to the side or even straight up.
Often, an aircraft model not designed specifically for FlightGear will not be positioned or oriented correctly; for example, it might be too far off the ground, and the nose might point to the side or even straight up.


Inside the XML wrapper file (not the main FlightGear property tree), there are six properties that allow you to tweak the default position and orientation of the model:
Inside the XML wrapper file (not the main FlightGear property tree), there are six properties that allow you to tweak the default position and orientation of the model:


'''/offsets/x-m''' <br>
'''/offsets/x-m''' <br />
The distance to reposition the model along the x-axis. <br>
The distance to reposition the model along the x-axis. <br />
'''/offsets/y-m''' <br>
'''/offsets/y-m''' <br />
The distance to reposition the model along the y-axis. <br>
The distance to reposition the model along the y-axis. <br />
'''/offsets/z-m''' <br>
'''/offsets/z-m''' <br />
The distance to reposition the model along the z-axis. <br>
The distance to reposition the model along the z-axis. <br />
'''/offsets/heading-deg'''<br>
'''/offsets/heading-deg'''<br />
The angle by which to rotate the model around the z-axis. <br>
The angle by which to rotate the model around the z-axis. <br />
'''/offsets/roll-deg''' <br>
'''/offsets/roll-deg''' <br />
The angle by which to rotate the model around the x-axis. <br>
The angle by which to rotate the model around the x-axis. <br />
'''/offsets/pitch-deg''' <br>
'''/offsets/pitch-deg''' <br />
The angle by which to rotate the model around the y-axis. <br>
The angle by which to rotate the model around the y-axis. <br />
For example, if you wanted to use the 3D model my-cessna.ac but found that the nose was pointing to the right instead of straight-ahead and the wheels were 1.5 metres off the ground, you could reorient it in the XML wrapper file like this:
For example, if you wanted to use the 3D model my-cessna.ac but found that the nose was pointing to the right instead of straight-ahead and the wheels were 1.5 metres off the ground, you could reorient it in the XML wrapper file like this:


Line 92: Line 92:
  </PropertyList>
  </PropertyList>


It usually takes a bit of experimentation to get the model positioned correctly. Also note that if your values are zero the offsets do not have to be included. All are demonstrated above to show the format.
It usually takes a bit of experimentation to get the model positioned correctly. Also note that if your values are zero the offsets do not have to be included. All are demonstrated above to show the format.


==Animating the Model==
== Animating the Model ==
{{Main article|Howto: Animate models‎‎}}
{{Main article|Howto: Animate models‎‎}}


Line 356: Line 356:


{{3d}}
{{3d}}


[[Category:Howto|3D Aircraft Models]]
[[Category:Howto|3D Aircraft Models]]
[[Category:Modeling]]
[[Category:Modeling]]