I'm not going to go into making the gauges as there are tons of different samples in THIS forum and at
http://www.aerodynamika.com/cgi-bin/yabb2/YaBB.pl?board=XML
As you probably know there are two types of gauges.
3D gauges and 2D gauges.
3D gauges are pretty much straight forward.
Create the mesh for each part then tag them with the animation manager using the Aces Tools.
2D gauges are a bit different.
To make them work in the sim you need to
- Make the xml code
- Create the bitmaps for each gauge
- Create the "gauge poly" in you model
- Create a new material in Max with the "Is virtual cockpit panel texture" checked.
- Map the correct gauge into the gauge poly
- New entry to the aircraft.cfg
As an example.
In my model there are two kinds of number readouts.
Got some digitals and some analogs.
For the analog I just created the mesh, mapped the part, animated the part and then tagged it with the correct animation code.
For the digital readouts I detached the poly as a new part where the readout is in the cockpit.
I don't want you to tear up your cockpit for this so just make a new poly inside your cockpit so you can easily see it.
Then apply the "is virtual cockpit panel texture" to the part.
Add a new unwrap uwv modifier the list and decide where on the map the gauge will be. You don't want it to be too big or too small.
Think about what you are planning too do.
Are you about to make a small gauge now or a big one?
Well, the digital read out is not that big gauge so it really does not have to take up a lot of space on the UVW map.
Since I know you are using Max use the create uvw template and export it to the resolution you want to.
1024 * 1024 is recommended.
Save the template as an jpeg and call it whatever you like.
The UVW template can now be used at the diffuse texture of the virtual cockpit material created earlier.
Now you know EXACTLY where the gauge are on the UVW map.
For the gauge itself this one is used.
Code:
<Gauge Name="ADF" Version="1.0">
<Image Name="7030_Background.bmp" ImageSizes="70,30,0,0"/>
<Element>
<Visible>(A:ELECTRICAL MASTER BATTERY, bool)</Visible>
<Element>
<Position X="23" Y="3"/>
<Text X="45" Y="7" Luminous="Yes" Length="7" Font="Digital-7" Fixed="Yes" FontWeight="800" Color="Gold">
<String>%((A:ADF1 ACTIVE FREQUENCY, KHz))%!06.1f!</String>
</Text>
</Element>
</Element>
</Gauge>
So it's just a simple readout of the ADF frequency.
You can see the gauge calls out for a image called 7030_Background.bmp.
Thats just a simple black image used as the backgound from where the numbers will show.
And the image has a size of 70 * 30 pixels.
So lets get cracking!
Make a new folder called that ever you like.
Place the folder inside the PANEL folder of your aircraft.
Make the image file at the correct size and fomat (bmp)
Copy the code provided into your prefereded editor (notepad++ is recommended) and save as an XML file.
Call the XML file ADF.
Drop both the XML file and the image into the folder you made.
Then open you aircraft.cfg and change the first
[Vcockpit01] entry into this:
[Vcockpit01]
file=What you called your image.bmp
Background_color=0,0,0
size_mm=1024,1024
visible=1
pixel_size=1024,1024
texture=What you called your image
gauge00=*What you called your folder*!ADF, 0,0,0,0
Remove the "*", but not the "!"
The 0,0,0,0 needs to be changes by you.
Mine reads 516,4,159,75 as the gauge is 516 pixels to the LEFT and 4 pixels down.
159 pixels wide and 75 pixel in height.
Open the UVW template you created in your photo editor and check the position of the gauge.
The first two zeros represents the position of the TOP LEFT CORNER OF THE GAUGE on the UVW template.
The last two represents the actual size of the gauge.
So check what pixel position the TOP LEFT CORNER of the gauge are and the BOTTOM RIGHT CORNER are.
Then it's just math with subtracting the pixels to get the size of your gauge.
Now make a copy of the template and move it to you panel folder.
Now export your X file and you know the drill.
Should work if I have not forgotten something important