Howto:Creating 3D instruments: Difference between revisions

Jump to navigation Jump to search
no edit summary
mNo edit summary
No edit summary
Line 95: Line 95:
  </animation>
  </animation>


'''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!)


'''Level of Detail:'''
However, the bottom half of the gauge contains a digital readout of the same information, and we haven't mentioned that yet.  In order to only introduce one new aspect at a time, for the moment I am going to ignore the fact that our input property is in degF and simply display it using the digits; there are several ways we could display degC (or indeed any kind of value) instead, but those are probably best left to another tutorial.
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.  Notice the <pre><!-- --></pre> section; this is a comment, feel free to add them where you need a reminder of what's going on.
 
Now, in order to give the illusion of a digital display, we are going to use a slightly less obvious technique than the simple rotation used for the needle.  Our digits are going to come from this texture, freshly borrowed from another model in FlightGear (remember, this is open source software - don't reinvent the wheel unless it's absolutely necessary!).
 
[[Image:digits.jpg]]
 
'''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.


<pre>
<pre>
57

edits

Navigation menu