PDA

View Full Version : FSX 3D Guages



BillgjCook
December 20th, 2009, 10:31
I have a question on building 3D gauges in G-max for FSX Accl. Sp2. Do I still have to XML code the gauges that I build in the VC for FSX, or can I use the animation tag?

N2056
December 21st, 2009, 12:16
There are some needle codes in the stock modeldef file. I have found that in many instances if they are not exactly what you want they are still good for modifying to get what you need. I recently upgraded my Thorp panel to use all 3d gauges, and it was not nearly as tough to do as I thought it would be.

BillgjCook
December 22nd, 2009, 09:22
The artificial horizon that I did would not work no matter what I did as far as key frame animation. Do you have aney tip to help me in the animating part of it. I am not to farmiliar with build 3D gauges wet.

Thank You

N2056
December 23rd, 2009, 15:41
Wow! You are going straight to one of the tougher ones to do :isadizzy:
I would suggest doing a few basic gauges first to get the hang of things. I'll work on getting something together to illustrate how I did my AH.

Mathias
December 23rd, 2009, 22:32
Not too difficult really as it can use a standard sim variable.
You need two animations, one each for pitch and bank where pitch is parented to bank card in Gmax.
The example shows a WWII arti that is limited in range but you can easily make it "full rotation" by setting the appropriate values to 180 rerspectively 360.
You also may want to play with the lag values:
Keyframes divided by lag= animation length in seconds.
And of course it needs a GUID.
Since we play in the + - ranges we need to tell the sim to start at keyframe zero. We do that with the bias setting.


<PartInfo>
<Name>fw190_attitude_pitch</Name>
<AnimLength>130</AnimLength>
<Animation>
<Parameter>
<Sim>
<Variable>ATTITUDE INDICATOR PITCH DEGREES</Variable>
<Units>degree</Units>
<Bias>65</Bias>
<MinValue>-65</MinValue>
<MaxValue>65</MaxValue>
</Sim>
<Lag>26</Lag>
</Parameter>
</Animation>
</PartInfo>

<PartInfo>
<Name>fw190_attitude_bank</Name>
<AnimLength>200</AnimLength>
<Animation>
<Parameter>
<Sim>
<Variable>ATTITUDE INDICATOR BANK DEGREES</Variable>
<Units>degree</Units>
<Bias>100</Bias>
<MinValue>-100</MinValue>
<MaxValue>100</MaxValue>
</Sim>
<Lag>40</Lag>
</Parameter>
</Animation>
</PartInfo>

BillgjCook
January 2nd, 2010, 09:47
Thank you for the reply it is very helpful. Now another queston, do you add the xml comand in the properties of the part in gmax? or is there a diferent place that it blonges?

FelixFFDS
January 2nd, 2010, 10:32
LIke all custom animations - the XML code is added to the modeldef.xml file, with the part keyframes and tagged/referenced to the XML code using the animation tool in gmax.

You can name your animated part "squggle" and as long as you match "squiggle" with the "fw190_attitude_pitch" tag (or as appropriate), you should be all right.

BillgjCook
January 4th, 2010, 09:03
Thank you. I am still not understanding how the animation is being linked with the XML, This is new for me as I am still learning. Thank you for helping me. One day it will all click for me. Is there a website that has info for this subject.

N2056
January 4th, 2010, 16:56
There are mostly a lot of forums with areas like this one. I think the best one currently in terms of code examples would be FreeFlightDesign (http://www.aerodynamika.com/cgi-bin/yabb/YaBB.cgi). It might help if we could see the type of artificial horizon you wish to duplicate. The one I did was a modern style...as seen on my current project. All of these gauges are 3d & working.

http://img138.imageshack.us/img138/8462/20091282051370.jpg

Mathias
January 5th, 2010, 02:24
Thank you. I am still not understanding how the animation is being linked with the XML, This is new for me as I am still learning. Thank you for helping me. One day it will all click for me. Is there a website that has info for this subject.

Ah ok, so back to the basics.
In FSX all animations are keyframed, no automatic tags like in FS8/FS9.
So let's say you want to animate a simple aileron, you would first look up one of the pre-defined animations by either opening modeldef.xml or by opening the Animation Manager from the Aces Tools menu in the Gmax top menu.
You need to know the pre-defined animation length to properly animate your part so best is to have a look into modeldef.xml and check just that.
I don't know where it is located when using Gmax.
For Max it is in
.......Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Environment Kit\Modeling SDK\3DSM9\Plugins
and an identical copy should be in
......Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Environment Kit\Modeling SDK\bin
Keep that in mind when modifying the file!

Code example:

This is the GUID that is needed for each animation:

<Animation name="l_aileron_percent_key" guid="bad53e9a-1958-4b22-90fe-23513d121db3" length="100" type="Sim" typeParam2="l_aileron_percent_key" typeParam="AutoPlay" />
Note the GUID needs to be unique for each animation.
A GUID generator can be downloaded here:
http://www.microsoft.com/downloads/details.aspx?familyid=94551f58-484f-4a8c-bb39-adb270833afc&displaylang=en

When viewing the GUID above it tells us the animation length is 100, so our aileron needs 100 keyframes from 0 to 100.

Just for completition's sake here is the rest of the aileron code which can be found farther down in modeldef.xml:


<PartInfo>
<Name>l_aileron_percent_key</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Sim>
<Variable>AILERON LEFT DEFLECTION PCT</Variable>
<Scale>-1</Scale>
<Units>percent</Units>
<Bias>50</Bias>
</Sim>
</Parameter>
</Animation>
</PartInfo>

Ok, now back to Gmax:
Animate your aileron using 100 keyframes.
Next with the aileron selected open up the Animation Manager and select the "l_aileron_percent_key" from the drop down list.
In the "start" and "end" boxes type the start and end keyframes and hit the "create" button (see attachement). That's it.
If your part is clickable you also need to add a mouse rectangle using the Attach Point Tool from the Aces Tools menu.
When doing custom animation you would need to add your new code to modeldef.xml just like in the examples above.

EDIT: Ouch! When hitting the "create" button, do not use the one at the bottom where the arrow points at, use the one above the "start" box, the one that is greyed out in the screenshot.

BillgjCook
January 5th, 2010, 09:43
That was perfect in explaining what I needed to know. As for the artificial horizon even a simple one would be a start for me. I am building a P-51 Race plane called Strega and I would like to build in 3D gauges in it as they look better and would give it a more real look in the VC. You all are so very helpful here, where would us rookies be without the pros.