187
edits
m (The International Standard is 'metre', a meter is like a parking meter or a light meter and not a unit of length.) |
|||
Line 1: | Line 1: | ||
This [[:Category:Howto|howto]] explains how to add 3D [[aircraft]] models to [[FlightGear]], and how to animate and position those models. No C++ programming is required, but the user will need some knowledge of FlightGear's property system and [[XML]] markup, and will need to understand the coordinate system FlightGear uses for its models: | This [[:Category:Howto|howto]] explains how to add 3D [[aircraft]] models to [[FlightGear]], and how to animate and position those models. No C++ programming is required, but the user will need some knowledge of FlightGear's property system and [[XML]] markup, and will need to understand the coordinate system FlightGear uses for its models: | ||
* distances are in | * distances are in metres | ||
* angles are in degrees | * angles are in degrees | ||
* the x-axis runs lengthwise, towards the back | * the x-axis runs lengthwise, towards the back | ||
Line 74: | Line 74: | ||
'''/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.wrl but found that the nose was pointing to the right instead of straight-ahead and the wheels were 1.5 | For example, if you wanted to use the 3D model my-cessna.wrl 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: | ||
<PropertyList> | <PropertyList> | ||
Line 183: | Line 183: | ||
Now, it is necessary to specify the axis of rotation for the object, its virtual hinge. This is often the hardest part, requiring a lot of trial-and-error when the axis of rotation is not lined up with the x-, y-, or z- axis (think of ailerons on a swept wing with a non-zero dihedral angle). You need to provide two groups of information: a point through which the axis of rotation passes, and the direction in which the axis is moving. | Now, it is necessary to specify the axis of rotation for the object, its virtual hinge. This is often the hardest part, requiring a lot of trial-and-error when the axis of rotation is not lined up with the x-, y-, or z- axis (think of ailerons on a swept wing with a non-zero dihedral angle). You need to provide two groups of information: a point through which the axis of rotation passes, and the direction in which the axis is moving. | ||
For the point through which the axis passes, you use the /center/x-m, /center/y-m, and /center/z-m properties to specify a position in | For the point through which the axis passes, you use the /center/x-m, /center/y-m, and /center/z-m properties to specify a position in metres, using the aircraft's coordinate system. Note that this is the system before repositioning: if the original model was pointing sideways, then your fuselage will run along the y-axis rather than the x-axis. Here is an example for a rudder: | ||
<nowiki> | <nowiki> | ||
Line 199: | Line 199: | ||
</nowiki> | </nowiki> | ||
In this example, the point is right on the y and z axes, but 5.45 | In this example, the point is right on the y and z axes, but 5.45 metres along the x axis (i.e. towards the back of the plane). | ||
Finally, in addition to the center point, it's necessary to specify the direction of the axis that passes through it, using the properties /axis/x, /axis/y, and axis/z. These are unitless values showing the rate of change in each direction; for example, a straight up-and-down rotational axis could be specified like this: | Finally, in addition to the center point, it's necessary to specify the direction of the axis that passes through it, using the properties /axis/x, /axis/y, and axis/z. These are unitless values showing the rate of change in each direction; for example, a straight up-and-down rotational axis could be specified like this: |
edits