Anyone who uses Flight Sim knows that a virtual cockpit is the 3D version of the aircraft cockpit. Today I am going to use FS Design Studio v3.5 to create a virtual cockpit for FSX. Not only will I make the main cockpit area, I’ll add a panel to it and show you the basics of how to get gauges onto a virtual cockpit panel.
I’m going to cover how to do the following things:
- Create a Virtual Cockpit model in an FSDS project
- Copy parts from the Main Model in FSDS to the new VC model
- Make a polygon out of existing points
- Create a new polygon from scratch
- Assign a material to a part
- Create and assign a VC texture to a part
- Edit a panel.cfg file to have gauges appear on it
- Rotate parts
- Flip polygons
Making this tutorial simple while still coverimg all of the major details needed is difficult. So what I’ll do is use the Curtis Jenny that comes with FSDS v3.5 as a starting point. It is a simple model with good detail. So to start, I’ll open the Jenny_MP.fsc file from the FSDS v3.5’s \Samples\CurtissJenny_FSX folder.
Step one will be to add a new model to the Curtiss Jenny model. This is done by choosing Model | Add Model from the menu in FSDS. This will open the Model Properties dialog. Here I will set the Name field to “Virtual Cockpit”. This name will appear on the status bar on the bottom of the main FSDS window when you are viewing the virtual cockpit Model. For the Model Type box, I’ll select Aircraft Virtual Cockpit. This tells FSDS how to handle the parts in this model.
After clicking OK, all of the parts of the Curtiss Jenny seem to have disappeared. Actually what has happened is we created a new model in our project. You can think of it as a project within a project. To better understand, take a look at the Status bar at the bottom of the FSDS screen.
I can see here that is reads Virtual Cockpit just as I entered it in the Model Properties window. Now I’ll switch back to the main model. You can cycle models two ways; 1) Use the SHIFT + M key to cycle through the different models, or 2) you can choose Model | Next Model from the menu. Since we only have two models, the main and the VC model, I’ll stick with SHIFT + M to cycle between the two models. Now I see the full Curtiss Jenny model and the Status Bar reads “Main Model”.
Since the virtual cockpit is inside the model looking out, I need to copy all of the parts from the main model that will be visible in the virtual cockpit model. With the type of plane we have, an open cockpit, this will be quite a few! We can safely avoid the wheels and wheel struts, but everything else is visible!
I begin by pressing the N key to move through the parts and pressing the spacebar on the parts I want to copy to the virtual cockpit model. Here is what it looks like when I’ve selected all the parts:
The only parts not selected in this project are all gear parts, all tire parts, all scrape points, the tail piece, axle, grill and the rear bulkhead. To check this yourself, you can open the Part | Select By Name dialog. All parts on the right side are selected; all parts on the left are not.
With the parts I want copied selected, I’ll choose Edit | Copy from the FSDS menu. Now I’ll press SHIFT + M to cycle to the next model; the virtual cockpit model. Once here, I’ll choose Edit | Paste from the menu. Now I have a near duplicate of my main model in my virtual cockpit model. It’s a good idea to check the Status Bar before doing any edits just to be sure you are working in the correct model.
NOTE: If some of the parts don’t appear, you can open the texture assignments window menu (press F4) and click OK. Don’t change anything - just open it and click OK and the parts will start to appear. You may have to do this for all parts that are not showing.
I’m going to compile this and take a look at it in FSX just to see where I am with it and get a feel for what I need to add to the model. Since there are not WWI bi-planes in FSX, I’ll use the Extra 300 since it’s at least a tail dragger.
Be sure to check the New Aircraft box so you don’t replace the Extra 300! Next I’ll fill in the basic information for the Curtiss Jenny and compile.
In FSX, I can see I now have a basic outline of a virtual cockpit.
NOTE: I’m going to take this time to cover something that did not pop-up in this example, but you will no doubt come across. When you make a part, be it a box or a tube, that part will only have one visible side. If you model a fuselage with windows and copy them into the virtual cockpit model, you will have exactly what you have in the main model - parts that are only visible on the outside. Since this is the virtual cockpit and you are now inside the plane, you need to flip these polygons around so the other side of them is visible. You can do this by entering Polygon Mode and choosing Flip All/Selected from the Polygon menu in FSDS. This will reverse the visible face of all polygons on the current part.
I can see from my image above, and when taking a closer look at the VC model in FSDS that there really isn’t a panel in place. The tan shape is the back of the seat in front of us. So the first thing I’ll do is make a polygon and set it in place for the panel. I’m not going to focus on fancy textures or anything; I’m just putting a polygon in there with a material. Once I have a place for a panel, I’ll show how to get gauges onto that panel.
Back in FSDS, I’ll move back into the virtual cockpit model.
NOTE: When compiling, FSDS always reverts to the main model. When you come back to do more edits, be sure to check the status bar!
I can get a better feel for what is missing in FSDS by examining the Perspective View. I can see the model of the sphere and I can see that in front of it there is no panel polygon. (The sphere is the viewpoint for the VC).
So I’ll add a polygon in front of the sphere and shape it to match the fuselage. I’ll do this by making the part Fuselage.Top.1 the current part. This is the upper part of the fuselage. Press the N key in Part mode to make it current. Once current I’ll enter point mode.
I marked on the image where I will be creating the polygon. I will select the points that are right in front of the sphere and tell FSDS to make a polygon from those selected points. To do this, I will make sure the Move, Rotate and Scale modes are OFF or not selected. Now I will click on the bottom point to make it current and I’ll press the space bar to select it (it will be white when current, yellow when selected but NOT current and green when current AND selected by default).
I need to take note of the Top view here as well. I see that even though I clicked the point in the Right view in FSDS, the point that was selected was on the left side of the plane. If I were to click that same point again, FSDS would make the point on the other side (right side) current. Looking at the top view though, I can clearly see that no 2 points lie in the plane.
To proceed, I will click on the next point just to the right of the one that is selected now in the Top view. When current, I’ll press the space bar to select it.
Now you should get the idea. I’ll continue to click the points from left to right along that line and select them until they are all selected (yellow/green).
When all points are selected, I’ll click the Polygon | Make Poly From Selected Point menu option.
This will create a polygon from those selected points.
Ok - FSDS made the polygon, but it’s backward. Notice the white line pointing forward. This shows the visible side of the polygon. I’ll select Polygon | Flip from the menu to flip it around so I can see it.
Gray is a bit drab, so I’ll change the material on the upper fuselage part to a brown color. I think there is already a brown material in the Materials List on the Curtiss Jenny project. So back in Part mode, I’ll open Part Properties (F2) and click the Materials button. I’ll select the material 112 56 0 255 from the list. This is a brown color. To verify this, you can select the material and click Edit to see the color, then click Cancel to return.
Now my polygon is brown. I’ll compile the model again and take a peek at it in FSX. Note that when compiling, FSDS will default to the Extra 300 again. I need to remember to change the reference aircraft to the Curtiss Jenny and NOT check the New Aircraft box. This way FSDS will replace the first Jenny model with the new one.
That’s better… Now we can make the VC polygon to put gauges on it.
An important thing to understand about the virtual cockpit polygon is that it is used by Flight Sim to draw the gauges on. Typically designers will take the polygon we made here and put a texture on it of the instrument panel to get all of the detail. They will then create a polygon that sits just a little bit in front of the textured polygon. It’s on this new polygon that the gauges will be drawn. This means that the new gauge polygon has to be transparent and we have to let Flight Sim know that we want the gauges to be drawn on it. How do we do that you ask? Well, that’s the purpose for the post…
I will switch back to my VC model by pressing SHIFT + M. I’ll create a new polygon by clicking the Polygon button on the Primitive Parts bar on the left of the FSDS screen. On the Create polygon dialog, I’ll enter 4 for the number of sides and 1 for the radius. I’ll also select Z as the Perpendicular Axis and click OK.
This will create a small diamond polygon in the center of the project. You may need to zoom out to see it (use the O key as in OUT to zoom out). I need to rotate the polygon 45º and move it into position. To rotate it, I’ll select Transform | Rotate from the menu and enter 45 for the Z axis and choose Entire Part and click OK.
After rotating it, I’ll reset the Part axis using the Part | Reset Axis Rotation to re-align the axis and I’ll use Move mode to move the polygon into position. Remember we want this to sit just a tiny bit in front of the brown polygon we made earlier.
Here’s the Perspective view:
In order to get gauges on this VC panel we have to assign it texture with a special file name. The special file name has to begin with the dollar sign ($) as found by pressing SHIFT and the number 4 on the top of your keyboard. Please don’t ask me why, but that’s the way FS wants it. This symbol tells Flight Sim which polygon the gauges will be drawn on. This $ symbol along with the rest of the texture file name will be used again when we do a little basic panel.cfg work later on.
It just so happens that one of these files is installed with FSDS! If you want to make your own, you can make a 256×256 bitmap image and reduce the colors to 256 colors and save it as $pan1 or $vc1 or something simple that starts with $. The trick is that it CANNOT have the .bmp extension in it. In other words, you will have to go into My Computer or Windows Explorer and rename the file to remove the .bmp from the end of it.
NOTE: If you don’t see the .bmp extension on your file when in My Computer or Windows Explorer, you will need to turn them on. You can do this by clicking the Tools menu in My Computer/Windows Explorer and choose Folder Options. On the View tab, REMOVE the check from “Hide extensions from known file types” and click Apply and OK. Now you should see the extensions on the file (.bmp and so on).
NOTE: To rename a file, you can right-click it and choose Rename from the pop-up menu. Use the arrow keys or the mouse to position the cursor and the backspace or delete keys to remove letters.
To proceed, I’ll use the $pan1 file that ships with FSDS. With my part current and in Part mode, I’ll open the Part Texture Properties by pressing F4. I’ll click the Select button next to the Back view to open the Texture List dialog. (Note that we apply it to the back view and not the front view since the polygon is facing backward). Since the $pan1 is not in the list, I’ll need to add it. I’ll click the Add button, then click the Browse button to locate the file.
Since there is no .bmp extension on the file, FSDS will not recognize the file. I will need to change the Files of Type drop down box on the Open dialog to All Files (*.*). Now I will browse into the FSDS v3.5 folder. The $pan file can be found in the Samples\FirstVC folder.
WHAT? How can there be a preview if there is no bitmap extension on the file? FSDS is smart enough to look at the content of the file and not just the file name. Don’t worry about the ‘G’ texture, when we’re all done, it won’t appear in FSX.
After clicking Open and then OK on the Texture Definition Dialog, I click the $pan1 in the Texture list and click OK. I click OK on the Part Texture Assignment window to return to FSDS. I can see that in the Perspective View, the texture has been applied.
To check this in Flight Sim, I’ll compile the model again.
Now I see the new polygon sitting in front of the brown polygon. The ‘G’ texture didn’t appear because it’s not really a bitmap file (no extension) and FS won’t load it even if it gets copied into the texture folder. So we’re good so far.
Now that I have the polygon, I’ll add some gauges to it. I’ll come back and make it transparent later. To add gauges to the polygon, we will need to edit the Panel.cfg file for the Curtiss Jenny. I’ll browse into my FSX’s \SimObjects\Airplanes folder and open the new folder created for the Jenny by FSDS.
NOTE: To find this fast, you can right-click the FSX icon on your Desktop, click Properties from the pop-up menu, then click the ‘Find Target’ or ‘Browse File Location’ or similar button to open the main folder of Flight Sim. Then you can double-click the SimObjects folder, then the Airplanes folder.
In the Jenny folder, I’ll double-click the Panel folder.
NOTE: Here you will see a panel already set up. Where did this come from? It came from the Extra 300 we used as a reference. FSDS borrows all aspects of the reference plane including the flight dynamics, panel and sounds. FSDS will copy the textures you apply to your model to the Model folder and the new model is generated by FSDS and copied into the Model folder.
We need to open the panel.cfg file. This is a text file and can be opened with Notepad. To open it, try double-clicking on the file. If you are asked, select “Choose a program from a list” (don’t choose to search the web for a compatible program!). Windows will show you a list of programs installed on your computer. Locate Notepad in the list and select it. If you want to, you can click the option to always use this program to open this type of file. This will save you from having to go through this every time!
I won’t go through every detail of the panel.cfg file but it’s pretty self-explanatory. The ‘WindowTitles’ at the top are the descriptions for the different pop-up windows in FS (GPS, Radio stack, Throttle and so on). The text after the equal sign appears in the View | Instrument Panel menu in FSX. Below that are the definitions of these windows that include the background bitmap, identifier (ident), visibility settings, sizes and lastly the gauges to draw on that window and where and what size to draw them. (if you are wondering, all lines that start with 2 backslashes (//) are ‘comments’ and are ignored by Flight Sim. If you want to remove something, you can put // in front of it and FS will ignore that line)
All we are interested for now in this file is the [VCockpit01] section. With the panel.cfg file open in Notepad, I’ll scroll through the file to find the [VCockpit01] section. I see it looks like this:
gauge00=Extra_XML!g_meter, 377, 289, 129, 129
gauge01=Extra_XML!turn_bank, 2, 3, 125, 125
gauge02=Extra_XML!oil_press, 2, 131, 127, 127
gauge03=Extra_XML!manifold_press, 198, 266, 123, 123
gauge04=Extra_XML!rpm, 131, 3, 123, 123
gauge05=Extra_XML!asi, 265, 132, 129, 130
gauge06=Extra_XML!attitude, 399, 179, 107, 106
gauge07=Extra_XML!altitude, 133, 130, 128, 128
gauge08=Extra_XML!vsi, 258, 3, 127, 126
gauge09=Extra_XML!compass, 2, 356, 93, 92
gauge10=Extra_XML!clock_&_oat, 100, 261, 94, 94
gauge11=Extra_XML!fuel, 2, 261, 93, 92
gauge12=Extra_XML!egt, 389, 3, 93, 92
gauge13=Extra_XML!switch_panel, 103, 443, 409, 69
gauge14=Extra_XML!annunciator_oil_press, 100, 359, 40, 40
gauge15=n_number_plaque!n_number_plaque, 100, 409, 89, 25
Notice the line texture=$extra_300s_1. There is that strange $ symbol again. When Microsoft designed the Extra 300, they applied a texture to the Extra 300’s VC polygon named $extra_300s_1. For this example, I’ll change this to read texture=$pan1. After making that change and saving the file, I’ll reload the plane in FSX and see what happens.
Well it worked right!? Not really… If you look close, you’ll see the gauges are upside down! How did that happen!? Well, you’ll have to chalk that up to ‘just another one of those things’. This is how Flight Sim works. The fix is pretty easy, though… In FSDS, we have to rotate the VC polygon along the X axis 180º. This will make the polygon face backward, then we have to flip the polygon’s visible surface.
Back in FSDS, I again go to the virtual cockpit model. With the new virtual cockpit polygon current and in Part mode, I select the Transform | Rotate menu. I enter 180 for the X axis and choose Entire Part and click OK. This rotates the part 180º. I then enter Polygon mode and select Polygon | Flip to invert the polygon. Sound confusing? I’ll recap that in steps:
1. Rotate the polygon 180 along the X axis
Transform | Rotate menu, enter 180 for X axis and click OK
2. Flip the Polygon
Enter Polygon Mode and select Flip
See - that’s not so bad… Let’s compile again and check it in FSX.
There we go… much, much better.
Notice that the black polygon where the gauges are is a bit too big for the background panel. You can resize the polygon if you want or move it to line up better. This is a quick test, so I’m skipping over that for now.
The last thing (well almost the last thing) I’ll do is make the polygon transparent. Sound difficult? It’s not at all. All we have to do is assign a material to it. The hitch is that the material has to have a specific name.
Back in FSDS I’ll again go to the VC mode (SHIFT + M) and with the new VC polygon current, I’ll press F2 to open the Part Properties. I’ll click the Material button and click Add. For the Material Name at the top, I’ll enter trans and click OK. Notice I don’t change any values on the window - just the name and click OK.
After doing so, and clicking OK. I then select trans from the material list and click OK, then OK again on the Part Properties. Note that there is NO CHANGE on the FSDS model’s Perspective view. I’ll compile one last time and check out my awesome work in FSX.
Woo Hoo!!! I love it when it works…
Notice as mentioned before that the gauges on the bottom hang off because our main polygon stretched below the brown, background polygon. To fix this you can adjust the size of the VC polygon.
Speaking of which, I want to cover a few more things about the VC polygons. Remember the [VCockpit01] section from above that I changed to look like this:
I want to discuss these lines one at a time and explain them a bit. This will come in handy when you are doing your projects in the future.
Background_color=0,0,0….. This sets the background color of the polygon. 0,0,0 is the Red, Blue and Green numbers (RGB). These range from 0 to 255. 0,0,0 is pure black and Flight Sim treats pure black as transparent on panels. If I change it read background_color=255,255,255, then FS will draw the background of my VC panel pure white.
This is confusing because you have to set a material called ‘trans’ to get the polygon invisible, but you can then make it solid by assigning a color in the panel.cfg…
size_mm=512,512…. This defines the size of the polygon. Typically this is set to the same as the pixel_size, which I’ll cover below.
visible=1…. I’m not sure what this does in the VCockpit section. It seems to have no effect. In the other sections ([Window01] and so on), it determines if the window is visible on start up or not (0=no, 1=yes).
pixel_size=512×512s…. This is where more confusion sets in. Our example polygon was a perfect square. The pizel_size setting tells FSX how many pixels are used on this polygon. In this case, FS will use 512 pixels across and 512 pixels down. Nice and even and nice and square. But what happens if your VC polygon is not a perfect square? That’s where it gets tricky.
NOTE: I’m not clear on why there is an ’s’ at the end of the line, but this is not needed and can be removed.
texture=$pan1… This is how FSX knows where to draw the gauges. The polygon that is textured with $pan1 in this case will show the gauges. I could have 2 polygons in FSDS that are BOTH mapped with $pan1. If I do this, then both polygons will have the exact same gauge mapping.
gauge00=Extra_XML!g_meter, 377, 289, 129, 129…… This tells FSX to draw the top left corner of the g_meter gauge found in the Extra_XML.cab gauge file at 377 pixels over form the left edge and 289 pixels down from the top edge. It then tells FSX to draw the gauge 129 pixels wide and 129 pixels tall.
What happens if we have a gauge polygon that is not a perfect square, but is a rectangle instead? Here I’ve reshaped my VC polygon into a rectangle that better fills the panel.
Without changing any of the gauge settings, you can see that the gauges are now stretched out across the polygon.
There are 2 ways to fix this:
- Change the size of the gauge entry. Our example has it sized at 129, 129. If we make it smaller along the X axis, that it won’t be stretched out as much.
- We can change the pixel_size and size_mm entries for the [VCockpit01] section. If we keep the 512 height, but make it about twice as wide, then it might turn out to be about right. I’m sure there is some mathematical formula to figure out the ratio, but that’s not my thing…
I’ll get tricky to find out the ratio… I’ll take a screen capture of the VC polygon straight on in Flight Sim. Then I’ll crop the image to the exact size of the polygon. Then I’ll resize the image to be exactly 512 pixels wide and let my paint program figure out the correct size for the width.
After doing so, I get about 1130 pixels wide. So I’ll change the VCockpit entry to read:
Let’s see what that looks like in FSX:
Now I have the proportion set properly, I just have to make the gauges bigger. The advantage to this is that I have more room to work with on the panel over the smaller square VC polygon. Some panel.cfg work needs to be done still to set up all the gauges properly.
If you would like to see the Jenny at this stage, you can download the project from here:
Abams FS Blog Curtiss Jenny VC Tutorial
This same procedure can be used to make additional VC polygons. You could add another polygon above this one, but smaller to fill in the top of the panel. To do this you could:
- Copy the $pan1 file
- Rename it to $pan2
- Apply it to the new polygon
- Set the material on the new polygon to the existing trans material
- Check the appearance in FSX
- Rotate and flip the polygon as needed
- Adjust the panel.cfg files [VCockpit02] section to accommodate the plane
- Set the pixel_size and size_mm entries
- Remove the ‘file=’ line (the Extra 300 has applied a bitmap to its VC polygon that we don’t want to use - you can delete the line or add a double back slash in front of it (//).
- Change the texture to “texture=$pan2″
If the gauges do not appear on the VC polygon in FS, then there is a problem with orientation of the polygon in FSDS or the panel.cfg entry. Check that everything is in place including:
- The part/polygon is textured on the correct side (front or back) - try both if necessary to figure it out
- The texture applied to the part starts with a $ symbol and does NOT have a .bmp extension on it
- The part has a material set to “trans”, “prop”, “window” or “glass” (any of these will work but I recommend “trans”)
- The panel.cfg file has been modified to read texture=$XXXX ($XXXX = your chosen texture name from FSDS)
- You have gauges mapped to the [VCockpit02] section in the panel.cfg file
If you have been following along, then congratulations on making a successful VC! Here I’ll recap the steps we took:
- Copied the parts of my main model in FSDS
- Created a new Virtual Cockpit model in FSDS
- Pasted the parts from the main model into the VC
- Created a polygon in the VC to use as a background bitmap (this can be textured with a detailed panel texture)
- I created a texture called $pan1 (you can use any name as long as it starts with a $ and has no bmp extension on it)
- I created a polygon for the gauges to appear on
- I positioned the polygon just in front of the panel background (the one you can apply a detailed texture to)
- I applied the $pan1 texture to the BACK of the new VC polygon
- I created a new material called “trans” and applied it to the new VC polygon
- I edited the panel.cfg of the plane to have the line “texture=$pan1″ (it has to match the name used as a texture in FSDS -step 5)
- I viewed the VC in FSX
- Back in FSDS I rotated the polygon 180º along the X axis
- I flipped the polygon to get it to draw the gauges correct.
- I continued to resize the VC polygon to better fit the panel
- I changed the dimensions in the panel.cfg file (pixel_size and size_mm)
Posted with permission from Adam Howe and Abacus Publishing.
For more information visit Adam Howe's Flight Simulator Design Studio Blog!