Howto:Creating 3D instruments: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
(Rewrite confusing section - "ind" is not from "indicated")
mNo edit summary
Line 1: Line 1:
'''Introduction:'''
This tutorial describes the basic process of '''creating''' a 3D '''instrument''' for use in [[FlightGear]].  For now, we're assuming that you have created the actual 3d model to use and wish to include it in a cockpit and animate it.  As an example, we will be animating the ITT gauge for the [[Fokker 50]].
This tutorial describes the basic process of creating a 3d instrument for use in FlightGear.  For now, we're assuming that you have created the actual 3d model to use and wish to include it in a cockpit and animate it.  As an example, we will be animating the ITT gauge for the Fokker 50.


'''What you need:'''
===Wat you need===
You will need; a text editor (even notepad will do, but one that does syntax highlighting might help you spot typos more easily; if you're on Windows, [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++] looks suitable.)
You will need:
* a text editor (even notepad will do, but one that does syntax highlighting might help you spot typos more easily; if you're on Windows, [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++] looks suitable.)
* your 3d modelling package
* and of course a copy of FlightGear


You will also need your 3d modelling package, and of course a copy of FlightGear.
===Creating the XML file===
 
The first step is to create an XML file which will load the 3D model and animate it.  There are no hard and fast rules about where these files should live or what they must be called, but we'll follow the fairly standard procedure of calling it itt.xml and placing it in the Models directory.
'''Creating the XML file:'''
The first step is to create an XML file which will load the 3d model and animate it.  There are no hard and fast rules about where these files should live or what they must be called, but we'll follow the fairly standard procedure of calling it itt.xml and placing it in the Models directory.


So, using your favourite text editor, create a file called itt.xml in the Aircraft/fokker50/Models directory (folder).
So, using your favourite text editor, create a file called itt.xml in the Aircraft/fokker50/Models directory (folder).
Line 29: Line 29:




'''Adding an animation:'''
===Adding an animation===


As you can see, the main item to animate is the temperature needle, and its name is "needle" (you can animate either ac3d "objects" or complete "groups").  We will want to use a "rotate" animation (for more details on available animation types, see "model-howto.html" which is provided with FG in the Docs directory.)
As you can see, the main item to animate is the temperature needle, and its name is "needle" (you can animate either [[AC3D]] "objects" or complete "groups").  We will want to use a "rotate" animation (for more details on available animation types, see "model-howto.html" which is provided with FG in the Docs directory.)


So, we add an <animation> section to our XML file.
So, we add an <animation> section to our XML file.
Line 97: Line 97:
</pre>
</pre>


'''Digital display:'''
===Digital display===
Our itt.xml file, as it stands, should now "work" in flightgear; that is, it will animate the needle object to display exhaust temperature on the first engine, in degC (despite the input property being in degF!)
Our itt.xml file, as it stands, should now "work" in flightgear; that is, it will animate the needle object to display exhaust temperature on the first engine, in degC (despite the input property being in degF!)


Line 147: Line 147:
And so on, for the remaining two.  Now, your itt instrument should display the EGT in degC using the needle, and give a "digital" readout of the same in degF.
And so on, for the remaining two.  Now, your itt instrument should display the EGT in degC using the needle, and give a "digital" readout of the same in degF.


'''Level Of Detail:'''
===Level Of Detail===
To prevent objects like this instrument being drawn when the aircraft is actually too far away for them to be seen anyway we use a Level Of Detail section (a "range" "animation".)  Notice the <pre><!-- --></pre> section; this is a comment, feel free to add them where you need a reminder of what's going on.
To prevent objects like this instrument being drawn when the aircraft is actually too far away for them to be seen anyway we use a Level Of Detail section (a "range" "animation".)  Notice the <pre><!-- --></pre> section; this is a comment, feel free to add them where you need a reminder of what's going on.


Line 162: Line 162:




'''Including the instrument in an aircraft:'''
===Including the instrument in an aircraft===


Now to the exciting bit, actually seeing the fruits of our labour in FlightGear!   
Now to the exciting bit, actually seeing the fruits of our labour in FlightGear!   
Line 186: Line 186:
Now, when you start flightgear, you should see your fully-working instrument in all its glory, situated where it ought to be!  If you need to move it later, it's trivial to tweak the numbers above to suit.
Now, when you start flightgear, you should see your fully-working instrument in all its glory, situated where it ought to be!  If you need to move it later, it's trivial to tweak the numbers above to suit.


[[Category:Aircraft enhancement]]
[[Category:Modeling]]
[[Category:Modeling]]

Navigation menu