Sign in to follow this  
Guest

Panel bitmap

Recommended Posts

I want to try to draw a panel texture to apply to the vc shown below and would like some advice on how to get started. The only ways I can think of is (1) draw each gauge on a background, or (2) find other panels and copy and paste the gauges to the background. Is there a better way?Thanks,John Woodward

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

>I want to try to draw a panel texture to apply to the vc >shown below and would like some advice on how to get >started. The only ways I can think of is (1) draw each gauge >on a background, or (2) find other panels and copy and paste >the gauges to the background. Is there a better way? John,I'm confused! Why would you want to put a static picture of a gauge on the VC?Sure enough, texture the panel! But put the same gauges you've used on the 2d panel on the VC panel...

Share this post


Link to post
Share on other sites

Hi Bill,Only because I am completely ignorant about how to do it. I would much prefer to make it functional. Any tutorials? Using FSDS.John

Share this post


Link to post
Share on other sites

>Hi Bill, >>Only because I am completely ignorant about how to do it. I >would much prefer to make it functional. Any tutorials? >Using FSDS. Well, not really... there is only one that I'm aware of, and it is based on 'early guesswork' from when VC's were very, very new, and no SDK's existed for FS2k2. As a result, although following the steps outline will get anyone started, there's a lot that is incomplete or misleading.So, I'm determined to write one as soon as the current project is released, using my experiences with that model, as well as the model itself as a sort of "talking board."I've actually outlined the process more than once in this forum, but rather than make you search the last seven months or so of messages, I'll attempt outlining enough to get you 'kick started.' :)Then, as you go along, feel free to ask questions at any point and one of us who've 'been there, done that' can help... Fair enough?OK then, let's cover some of the basics...I) Definitions & Rules1) FS2k2 'projects' images of gauges that're defined in the panel.cfg onto a transparent 'screen' that you provide in the model. All we are able at this time to use are 'regular gauges.' A certain payware company has developed the tools that will allow 'vector graphic drawn gauges' (such as the gps or Eric Marciano's F16 Radar Gauge) in a Virtual Cockpit, but thus far it is not available for the general public (us!) to use...2) The program you use to create the FS2k2 model is irrelevant; either GMax or FSDS is quite capable of making a fine VC, as the 'magic' is actually done by FS2k2... :)3) Basically, you need to create a planar surface (i.e., 'flat sheet') on which to apply a dummy texture. It is the name we give the texture that is important, not the texture itself! All dummy textures are named with the prefix $, so a primary panel's texture might be called something like $primary_panel.bmp4) The most important thing to remember is that all of the dummy textures used to create a VC panel must be square, and must be of a size that is a "power of 2." In simple terms, the .bmp files must be 256x256, 512,512, or 1024,1024...5) There is no rule that the planar surface has to be any particular shape or size, only the texture applied to it! (more on this later.)II) Basic Steps to Create a Simple VC Panel1) Start a new project in FSDS (or GMax) to experiment with.2) Create a simple planar surface of about 16"x8" (there is a reason for this particular size, as we're going to use it to illustrate a major point in VC design later)3) In your favorite paint program, create a totally black (0,0,0) image of 512x512 pixels, and name it $my_first_vc4) Go back to FSDS or GMax, and apply the texture $my_first_vc to the planar object you created in step 2. You do not need to copy the texture anywhere, as it is only a "dummy" used to assign a name to the map in the .mdl file that will be generated by FSDS or GMax. FS2k2 will auto-generate the texture needed at run time. Make sure that when you position the texture, you align the top half of the texture with the top of the rectangular surface you created. FS2k2 uses the pixel coordinates of the texture for gauge placement, not the object!5) Export your work to a .mdl file...6) Now the fun begins! The way gauges are placed on the little panel you've just created is via the panel.cfg file. Here is a snippet from the C172's panel.cfg for one part of a VC. (I've replaced the square bracket with a { because of being posted here... square brackets are used instead of > and < for HTML code!).{VCockpit01}size_mm=512,512pixel_size=512,512texture=$C172s_1background_color=0,0,0visible=0gauge00=Bendix_King_Radio!Bendix-King Radio Nav-Comm 1, 0, 0, 205, 77gauge01=Bendix_King_Radio!Bendix-King Radio Nav-Comm 2, 206, 0, 205, 77gauge02=Cessna172!Clock, 413, 1, 93, 93gauge03=Bendix_King_Radio!Bendix-King Radio DME, 0, 86, 198, 51gauge04=Bendix_King_Radio!Bendix-King Radio Audio, 201, 85, 198, 34gauge05=Cessna!Annunciator, 403, 96, 109, 30gauge06=Bendix_King_Radio!Bendix-King Radio AP, 0, 136, 198, 59gauge07=Bendix_King_Radio!Bendix-King Radio Xpndr, 0, 196, 198, 61gauge08=Cessna182s!VOR2, 257, 129, 126, 126gauge09=Cessna!ADF, 385, 130, 126, 126gauge10=Cessna!VOR1, 1, 258, 126, 126gauge11=Cessna!Vertical_Speed, 129, 256, 126, 126gauge12=Cessna172!Airspeed, 256, 256, 128, 128gauge13=Cessna!Turn_Indicator, 384, 256, 128, 128gauge14=Cessna!Altimeter, 1, 383, 126, 126gauge15=Cessna172!Tachometer, 128, 383, 128, 128gauge16=Cessna!Heading_Indicator, 256, 384, 128, 128gauge17=Cessna!Attitude, 383, 384, 128, 1287) Take careful note of how this part of the panel.cfg is different from the 2d sections. a) size_pixel and size_mm are both 512,512 (sound familiar?) :( the name of the texture file is $C172s_1 (hmmm strike a chord here?) c) background_color is set to 0,0,0 (transparent!)8) The reason I picked this particular file was because it will allow you to rather quickly see the fruits of your work so far... a) make a copy of the C172's panel.cfg file for later use. :( edit the texture line in the section quoted above to be:texture=$my_first_vc c) rename the C172's cessna172sp.mdl file to cessna172sp.mdl.bak for safekeeping. d) move the .mdl file you just created to the C172's model folder, rename it cessna172sp.mdl and start FS2k2. Choose the C172 a/c and let it load. e) when you switch to the virtual cockpit, assuming you followed all the steps carefully, you should see a little 16"x8" panel "floating" in front of your face, with all the gauges applied...9) Notice that even though you created a rectangular panel, and a square bitmap, only the solid surface upon which the texture was applied will be visible! Because the image is transparent, where there is no 'surface,' there is nothing at all!When you get this far, please let me know and we can continue from there!Have Fun!Oh yes! Be sure to remove your changed files and rename the default Cessna's files! :)Bill

Share this post


Link to post
Share on other sites

Thanks Bill. More than fair enough.I printed out your directions and will probably start next week. As you can see from my other posts, I am having a difficult time with animation so maybe I will take a break and start now instead.You are pretty well on the way to a tutorial as is.Thanks,John

Share this post


Link to post
Share on other sites

John, go to http://www.abacuspub.com/fsds2/tips.htm There is a nice quickie VC tutorial by Bill Lyons.. I actualy was able to figure out and now I have a working VC on my RV-6A (too be released shortly) also go to www.freeflightdesign.com and look in the tutorials section for a FSDS VC cockpit tutorial. by using both of them you should get it working fine. Also if you need any animation help let me know.Brian

Share this post


Link to post
Share on other sites

>John, go to http://www.abacuspub.com/fsds2/tips.htm There is >a nice quickie VC tutorial by Bill Lyons.. I actualy was >able to figure out and now I have a working VC on my RV-6A >(too be released shortlyUnfortunately, Bill makes the same error that many others make...It is not necessary (or even necessarily desireable!) to use a "square" surface for the $pan1.bmp You can use a small circle, rectangle, trapezoid, parallelogram, triangle...IOW, whatever shape fits the available cockpit space!Now why is something like this important to know?Because if you use a 24x24 square to fit a 24x12 space, you'll have a big, ugly honking black slab spoiling your nice cockpit should you decide to try your hand at backlighting the gauges! :() also go to >www.freeflightdesign.com and look in the tutorials section >for a FSDS VC cockpit tutorial. by using both of them you >should get it working fine. Also if you need any animation >help let me know. Also, Chris's otherwise excellent tutorial (which helped me get started) leaves out a few bits of vital information, that caused me several days of anguish and frustration.The most important thing is that the textures must be 8 bit indexed .bmp files, not 16 or 24 bit RGB... :(

Share this post


Link to post
Share on other sites

Hi Bill,Here it is so far. I copy and pasted the two panels and applied a separate dummy texture to each. For some reason I had to invert the textures. Must be a difference in FSDS on how the coordinates are used. Otherwise the gauges were upside down.This cockpit has 5 panels. I think most of the gauges would not be functional, just pictures. Next I want to look for some better gauges and work on the placement. Filling in all the blank areas with switches, levers, knobs, and all kinds of other stuff I am not sure about yet, but I think I may copy and paste from other panel bitmaps.Thanks so much for helping me get started.John

Share this post


Link to post
Share on other sites

>Hi Bill, >>Here it is so far. I copy and pasted the two panels and >applied a separate dummy texture to each. For some reason I >had to invert the textures. Must be a difference in FSDS on >how the coordinates are used. Otherwise the gauges were >upside down. >>This cockpit has 5 panels. I think most of the gauges would >not be functional, just pictures. Next I want to look for >some better gauges and work on the placement. Filling in all >the blank areas with switches, levers, knobs, and all kinds >of other stuff I am not sure about yet, but I think I may >copy and paste from other panel bitmaps. Hey! That's beginning to look very, very good!It's certainly better than my stumbling beginings... :)Holler away if you need more help!

Share this post


Link to post
Share on other sites

Hi Bill,Here is the procedure that I have used for FSDS2:1. Make 3 copies of the panel and give each a different name such as panel_main, panel_vc, and panel_gauges.2. Put panel_main into the main model. This panel gets the bitmap containing gauges so that they will be seen in the spot view.3. Put panel_vc into the VC model. Apply a plain background texture to it (no gauges). I looked through existing panel bitmaps, cut out a section, and pasted it into a 256x256 texture.4. Also put panel_gauges into the VC model. I found it was necessary to space this one slightly off the surface of panel_vc for the textures to show correctly. This panel gets the square transparent texture that you described. The only thing in FSDS2 is that you have to check Invert Y or else the gauges come in upside down.I am still working on textures. For the main panel (in spot view) I went into FS2002 and made a screen shot of the VC view, then cut and pasted the gauges onto a background. I still need lots of little switches and non-functional gauges, etc.John Woodward

Share this post


Link to post
Share on other sites

>3. Put panel_vc into the VC model. Apply a plain background >texture to it (no gauges). I looked through existing panel >bitmaps, cut out a section, and pasted it into a 256x256 >texture. >>4. Also put panel_gauges into the VC model. I found it was >necessary to space this one slightly off the surface of >panel_vc for the textures to show correctly. This panel gets >the square transparent texture that you described. The only >thing in FSDS2 is that you have to check Invert Y or else >the gauges come in upside down. >>I am still working on textures. For the main panel (in spot >view) I went into FS2002 and made a screen shot of the VC >view, then cut and pasted the gauges onto a background. I >still need lots of little switches and non-functional >gauges, etc. That is a good, safe and easy method, although I opted to use the 'real live gauges' throughout, so that you can 'ride the wing' and still see the gauges working... :)Another method of doing textures on the VC is to use only one surface, and apply both the $dummytexture.bmp and the actual panel textures on it. This is done in the panel.cfg file like this:[Vcockpit01]file=panel_P1_background.bmp Background_color=0,0,0 size_mm=512,512visible=0pixel_size=512,512texture=$P1Notice that the panel's texture is applied in the file= entry, and the $dummybitmap texture is applied in the texture= entry.Now the 'crowning touch' will occur when you specify to use a specular highlight file named the same as the $dummybitmap.bmp without the $ prefix. This file is applied in GMax as a 'self-illuminating' mask. I do not know if FSDS2 supports this feature.The 'mask' acts in a similar fashion as a reflective alpha mask, but instead identifies the areas of the panel that should be 'illuminated,' hence the cool backlighted gauges! :)

Share this post


Link to post
Share on other sites

My gauges are appearing on the vc panel stretched horizontally. I know you said that the dimensions of the geometric plane does not matter, that it can be a circle if you want, but when I resize my panel (rectangular plane) it _appears_ that this affects the asepct ratio of the gauges. I am seeing things?My vc texture is 512 x 512.Steve

Share this post


Link to post
Share on other sites

I also had distorted gauges. I thought it was just from the viewing position since ones closer to the eyepoint were round. I played around with the size dimensions (default 128 x 128) until they looked right.John Woodward

Share this post


Link to post
Share on other sites

Here is what I'm talking about.The second photo shows the panel with the original width. The panel is a geometric plane. It has not been converted to any of the 'mesh' forms, so the size can be adjusted without scaling.The first photo shows the panel size increased from 33cm wide to 60 cm wide.Steve

Share this post


Link to post
Share on other sites

bumping this so I'll have a chance someone will look at the pics before they get deleted.

Share this post


Link to post
Share on other sites

>My gauges are appearing on the vc panel stretched >horizontally. I know you said that the dimensions of the >geometric plane does not matter, that it can be a circle if >you want, but when I resize my panel (rectangular plane) it >_appears_ that this affects the asepct ratio of the gauges. >I am seeing things? >>My vc texture is 512 x 512. Steve,I apologize for not replying sooner, but I've been a bit preoccupied and just missed your question...There are five sets of dimensions that come into play here:1) size/shape of the planar surface (projection surface), can be anything you want that fits the available shape/space/special needs.2) the UVW map for the projection screen must be square, but the physical size is not critical, so long as the entire projection surface is covered.3) the $dummytexture.bmp must be square, and a power of 2; i.e., 256.256; 512,512; 1024,1024.4) the defined size of the background "image" (pixel_size=) used in the vcockpit section of the panel.cfg must be square, and match the dimensions of the $dummytexture.bmp declared in item #3.5) the size parameter in mm must be the same as item #4, or else size_ratio must be used to define the relationship.For example, in one of the sub-panels of the TB20GT you will note the following entry:{Vcockpit04}file=panel_P4_background.BMP Background_color=0,0,0 size_mm=256,256visible=0pixel_size=256,256texture=$bdvc_04gauge00=TB20GT!Gear Lever, 206,9,37,23gauge01=TB20GT!Gyro Suction, 82,4,35,331) In the .mdl, the planar surface is a small rectangle about 18"x5.2" that is sized to fit the space on the panel for the two gauges I need to display.2) The UVW map is therefore 18"x18" square3) The $bdvc_04.bmp file is 256x256 pixels4) The pixel_size=256,2565) The size_mm=256,256This last entry ensures that there is an exact 1:1 relationship between pixels and mm. This is critical, because the display engine in FS2k2 uses mm in it's calculations for gauge drawing!Note also, that in this particular case, I've chosen to apply the panel's texture using the file=panel_P4_background.BMP option in the panel.cfg, instead of applying it in GMax... either way will work, but I just happened to find this more convenient for this part of the panel... :)I hope these notes will help! I suspect that you don't have a size_mm= parameter defined in your vcockpit section, or possibly it is incorrect. That is the usual cause of 'pixel stretching.'

Share this post


Link to post
Share on other sites

Panel cfg is{VCockpit01}size_mm=512,512pixel_size=512,512texture=$civic_1background_color=0,0,0visible=0Looking at the dummy texture applied in gmax, $civic_1.bmp, it is 512 x 512 24 bit color.The "plane" floats in front of the real panel.I do not use a texture file.I think I will check the UVW Map. Never thought of that. Okay, the panel was from a simple experiment, so it never got a UVW Map applied, just textured with the dummy texture.Hmm, once applied, I can see the UVW map wire frame outline around the dimesions of my planar shape. If I go back to adjust the width I notice it does not inherit through to the mapping. I can then adjust the UVW map frame and watch it move outward until it equals the new panel width.I'll test now.Steve

Share this post


Link to post
Share on other sites

Is it required to UVW map and UVW Unwrap the panel? After several tries to get the gauges in correct aspect ratio I thought what if I adjusted the UVW map using the Edit button and the Edit UVW's dialog. By squeezing the outline of the panel against my square graphic I was able to get the gauges to display in almost their normal aspect ratio. Apparently FS displays these in the virtual cockpit with some kind of perspective adjustment because at 50% zoom they look correct, but closer they show a little bit of horizontal stretching. I did this by eye, so it is no surprise the aspect ratio is not perfect.So the gauges are almost square, but now they seem to tile across the panel, i.e. I see double gauges beyond the panel and I have not had any wine either.You can see what it looks like in the Edit UVW window.Steve

Share this post


Link to post
Share on other sites

>So the gauges are almost square, but now they seem to tile >across the panel, i.e. I see double gauges beyond the panel >and I have not had any wine either. >>You can see what it looks like in the Edit UVW window. >>Steve No, do not use UVW Unwrap at all. You've made this way more complicated than it needs to be... :)The following picture shows how I've created two planar surfaces, P1 & P2 to overlay the panel area in the new Beriev. There are two UVW maps of identical size that are used to 'map' the two surfaces, and $P1.bmp and $P2.bmp are applied to their respective surfaces.Take note of how I positioned and sized the maps to exactly cover the entire panel's surface from edge to edge, and aligned them with the top of the panel.The areas where there is no 'surface' will therefore be totally invisible. IOW, only the 'black areas' will show up in FS2k2 and act as projection screens.Because the UVW maps are perfectly square, I am then free to use whatever size image I want. In this case, both $Px.bmp files are 512,512.BTW, do NOT use 24 bit images anywhere in the VC. Use only 8 bit indexed graphics. FS2k2 just doesn't like 24 bit RGB texture files in the VC or interior at all...

Share this post


Link to post
Share on other sites

More about this subject.Once I had the basic mapping done for the VC, I loaded up FS2k2, adjusted the view angle, and then 'snapped a picture' of the blank panel.Now I've got a dandy background to use in FSPanel Studio (or cfgedit) to help with final placement of the gauges! :)Also, cropping the image now gives me a basic start on the 2d panel bitmap as well... :)

Share this post


Link to post
Share on other sites

It certainly was getting harder, but I was merely exploring all the possible reasons for failure as I would when debugging a program. I am unaware of any detailed documentation on making a virtual cockpit, so would not know the role played by the UVW Map, although I suppose it could be guessed at.It appears that the aspect ratio of the projected panel and its gauges is controlled by the dimensions of the UVW Map applied to the planar object. From my experimentation, I can report that if you set all three Tile factors to zero, that the gauges disappear. This may be what happened when some in this group reported their panel disappearing. So I set mine back to 1. When you do, you can see the dummy texture appear (I use a gray one with some words on it for orientation as Chris's tutorial showed, not black).Once I made a square UVW Map and enlarged it to just about the size of my panel object width (trying to keep it backed off a little so the tiled instruments do not show up), the gauges showed the correct aspect ratio.My next problem was the gauges appeared to be too big (actually they appear closer to the eye point instead of larger sometimes) or my panel too small. I thought perhaps I had underestimated the area required to fit the gauges on the panel. However, after doing some calculations in millimeters (the panel unit) I discovered my airspeed and altimeter gauges swapped from some old panel were about double their actual size. The standard opening is 57mm and these were set to 103 in then panel. Reducing the size to 57 made for a lot room!I am still a little uncertain about this, because my engine gauges are supposed to be 2" and they appear as large as the airspeed indicator. They should be close, but they look a little larger than they should by eye. I think this is due to the area surrounding the airspeed indicator being included in its width, i.e the graphic include the mounting screws, etc. where the gauge face is probably exactly 2 1/4" or 57mm, so I may have to allow for that area of the graphic outside the diameter of the face.I had to move the gauges around and resize them quite a bit to fit the virtual panel compared to the 2D locations. I suspect that for the 2D panel I had adjusted them to be readable not to be exact size of the real instrument.

Share this post


Link to post
Share on other sites

Photo of progress.Square UVW Map resulted in correct aspect ratio for gauges.I noticed that when you create a panel 'plane' in the shape of the aircraft panel (or a rectangle close in dimension) the UVW Map dimensions are the same or a retangle bounding the shape minimally. This means you must adjust the dimensions of the map until they are square. It does not default to this state.Steve

Share this post


Link to post
Share on other sites

>Photo of progress. >>Square UVW Map resulted in correct aspect ratio for gauges. >>I noticed that when you create a panel 'plane' in the shape >of the aircraft panel (or a rectangle close in dimension) >the UVW Map dimensions are the same or a retangle bounding >the shape minimally. This means you must adjust the >dimensions of the map until they are square. It does not >default to this state. That is correct, the 'bounding box' for the UVW map will try to 'fit' the largest dimension, either height or width. Take the largest value and apply it to the other axis, and you now have a square 'map.'The UVW coordinates define the relationship with the xyz coordinates of the model. That's why 'fiddling' with the UVW map size can have very unpredictable results! :(The 'color' of the $dummytexture.bmp isn't truly important, because FS2k2 will always generate the color of the dynamic map based on the values entered in the v-cockpit section.That looks much nicer now! Congratulations!

Share this post


Link to post
Share on other sites

I'm getting there. The panel (not the 'plane') is actually slanted because that is the way the picture of the Boorabee II shows the outside of the panel area. It may be slanted IRL, but that is not very good for viewing in FS, so I will have to find some way of making it vertical beneath the overhang when the front poly is deleted.Today I completed the ammeter and added a digital tachometer. That just about uses up all the room on the panel. I will have to make a seperate panel for the flaps handle.I have to decide whether to make pods for the engine guages that are hanging down below the panel or perhaps make pods on the sides in the corners.Next I have to decide how to texture the panel. Whether to tile a panel texture across the panel shape or to use a seperate panel graphic.You can probably tell there are two version of the plane. I didn't make that EIS gauge for nuthin' :)I may borrow your transponder if you will be nice enough to let me include it.I have not downloaded the Socata, but am very anxious to fly it. I hate long, start and stop downloads (that Netscape, never could download it after version 6) so have tried to avoid the rush. Will do when I have a quiet moment.Steve

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this