• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA Kohlsman scale animation/code

euroastar350

Resource contributor
Messages
826
Country
us-delaware
Hi guys,

Quietly plugging away at the Trislander and need help/advice on the animation of the Kohlsman scale. I have the part(s) modeled and textured, but not animated just yet. How would I go about the animation and proper code to make it functional?

BTW, the Trislander just passed the 300,000 polygon mark with more or less to be added ;)
render_070.png
render_071.png
 
Messages
1,451
Country
mexico
Hi George

First is first. I am sure the scale is incorrect. To prove it, I grabbed the gauge to the simulator:

Alt_reading_01.jpg


I had this readings:
  1. From the image, 1015.5 mbar and something close to 30.087 inHg.
  2. Correct 1:1 match: 1015.5 mbar its real equivalent is a value close to 29.9877 inHg
1 mbar = 0.02952999 inHg
1 inHg = 33.86388 mbar


The result in the actual scale:
Alt_reading_02.jpg


As you can see, the scale is utterly wrong (all is my fault; I am very sorry). When we designed the art for the 206, at least I never tested the 2D gauge in the simulator... until now. :oops: :oops: :oops:

Another issue, it is unknown to me which are the inicial and final values for each side; that would make it easier to rectify or correct the scale. That being said, lets supose that the actual scale is correct and each value in mbars matches horizontally with its equivalent inHg (for reference). From my real limited knowledge doing custom animations, once the scale is right, you need to animate the rotation considering the range of values and the exact angles where the initial and final values are seated on the scale. Here is the code I used for this scale in the 2D gauge (FS9 version):

HTML:
   <Element>
      <Position X="375" Y="375"/>
      <Image Name="206_altimeter_Kohlsman.bmp">
         <!--<Axis X="375" Y="375" PointsTo="East"/> -->
         <Axis X="375" Y="375"/>
      </Image>
      <Rotate>
         <!-- <Value Minimum="29.70" Maximum="30.30"> (A:Kohlsman setting hg, inHg)</Value> -->
         <!-- <Value>(A:Kohlsman setting hg, inHg)</Value> -->
         <Value> (A:Kohlsman setting hg, inHg) 29.60 max 30.40 min </Value>
         <Failures>
            <GAUGE_ALTIMETER Action="Freeze"/>
            <SYSTEM_PITOT_STATIC Action="Freeze"/>
                  <SYSTEM_ELECTRICAL_PANELS Action="Freeze"/>
         </Failures>
           <Nonlinearity>
             <Item Value="29.60" X="374" Y="66"/>
             <Item Value="30.40" X="375" Y="684"/>
           </Nonlinearity>
      </Rotate>
   </Element>

It should be easier for you to translate this code to a custom animation.

Also, attached to this thread, is the actual gauge (it does not have implemented the calibration button). The issue at hand has not been solved; however some problems have been spotted before you begin to code the 3D altimeter. I am sure that you will get it right and the real help is on the way.

Addendum:
This sort of work, in the real world is made with a proper CAD program in order to have precise measurents. At least for me, in photoshop is very hard to get the rotations right. The program shifts the selection from the geometric center each time I attempt to rotate segments of an image. For that reason, the program "offers" the option to choose the center of rotation. It is not the same to rotate pixels than mechanical pieces! This is not an excuse, I did it wrong.
 

Attachments

  • Bell_206_altimeter.zip
    206.4 KB · Views: 145
Last edited:

Paul Domingue

Resource contributor
Messages
1,530
Country
us-california
Hi guys,

Quietly plugging away at the Trislander and need help/advice on the animation of the Kohlsman scale. I have the part(s) modeled and textured, but not animated just yet. How would I go about the animation and proper code to make it functional?

BTW, the Trislander just passed the 300,000 polygon mark with more or less to be added ;)
If it is a 3d gauge search the modeldef.xml file for drum_kohlsman, it will give you all the information you need.
 

euroastar350

Resource contributor
Messages
826
Country
us-delaware
I see 2 different codes, one for "MB and one for "InHg", so I'm not sure which one to use. Since these are 3D parts, where does the keyframe start and end for animations?
 

Paul Domingue

Resource contributor
Messages
1,530
Country
us-california
I see 2 different codes, one for "MB and one for "InHg", so I'm not sure which one to use. Since these are 3D parts, where does the keyframe start and end for animations?
Use the measurement scale that would apply for the aircraft. FSX is set for InHg which is used in all modern aircraft. If the gauge was in a Spitfire it would read in Mb.
The stock code is set to 360 frames but you can write your own code using the number of frames you need. Just copy the stock code and alter it as needed. Don't forget to give your code a new name and GUID. Follow the guidelines stated in the SDK for creating custom code.
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
If it were me, I'd keyframe animate the disk using the Mb scale, since it uses "whole numbers." This way the inHb would remain synchronized with the Mb setting.
 

euroastar350

Resource contributor
Messages
826
Country
us-delaware
If it were me, I'd keyframe animate the disk using the Mb scale, since it uses "whole numbers." This way the inHb would remain synchronized with the Mb setting.

Where would I place the start and end keyframes when animating? Other then that, great useful tip and now I can have a properly animated altimeter :)
 

tgibson

Resource contributor
Messages
11,338
Country
us-california
My FSX SDK modeldef.xml file contains no such drum_kohlsman part, nor anything related to kohlsman or drum. Weird.
 

Paul Domingue

Resource contributor
Messages
1,530
Country
us-california
My FSX SDK modeldef.xml file contains no such drum_kohlsman part, nor anything related to kohlsman or drum. Weird.
You should find drum_kohlsman animation names a few lines below <!-- Begin created by Virtuali for FA-18 --> which is line #401 in the modeldef.xml file for FSXA. If you only have the older FSX SDK minus A that may be the reason you don't see it.
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
Where would I place the start and end keyframes when animating? Other then that, great useful tip and now I can have a properly animated altimeter :)
You have a total of 13 whole numbered MB data points. Allowing for 5 'units' for each major tickmark, you would need 60 frames total.

980 @ frame 0
985 @ frame 5
990 @ frame 10
etc.
1040 @ frame 60
Code:
      <Parameter>
        <Code>(A:KOHLSMAN SETTING MB, millibars) 980 - 0 max 60 min</Code>
      </Parameter>

A very important rule for animation in modeldef.xml scripts is this forumula:
Code:
SIM: Converts simvar to keyframes: simvar * scale + bias = keyframes
For this application, no "scale" is required so we can leave it out.
(A:KOHLSMAN SETTING MB, millibars) is our "simvar"
980 is our "bias"

simvar - bias = keyframe

980 - 980 = frame 0
985 - 980 = frame 5
990 - 980 = frame 10
etc.
1040 - 980 = frame 60

We want to limit the range of the animation so we include the min and max range limits. It's actually a quite simple and elegant solution!
 
Last edited:

euroastar350

Resource contributor
Messages
826
Country
us-delaware
You have a total of 13 whole numbered MB data points. Allowing for 5 'units' for each major tickmark, you would need 60 frames total.

980 @ frame 0
985 @ frame 5
990 @ frame 10
etc.
1040 @ frame 60
Code:
      <Parameter>
        <Code>(A:KOHLSMAN SETTING MB, millibars) 980 - 0 max 60 min</Code>
      </Parameter>

A very important rule for animation in modeldef.xml scripts is this forumula:
Code:
SIM: Converts simvar to keyframes: simvar * scale + bias = keyframes
For this application, no "scale" is required so we can leave it out.
(A:KOHLSMAN SETTING MB, millibars) is our "simvar"
980 is our "bias"

simvar - bias = keyframe

980 - 980 = frame 0
985 - 980 = frame 5
990 - 980 = frame 10
etc.
1040 - 980 = frame 60

We want to limit the range of the animation so we include the min and max range limits. It's actually a quite simple and elegant solution!


You are the man Bill, this is most excellent. Now it's off to finish the altimeter on the Trislander :)
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
You are the man Bill, this is most excellent. Now it's off to finish the altimeter on the Trislander :)
For whatever it's worth, I consider the 'formula' above to be so important that I keep it, along with some other tips as "comments" at the very top of every modeldef.xml file!

I hope my explanation of how the 'formula' translates in actual practice was clear, so your next animation task becomes easier. :teacher:
 
Messages
1,451
Country
mexico
For whatever it's worth, I consider the 'formula' above to be so important that I keep it, along with some other tips as "comments" at the very top of every modeldef.xml file!

I hope my explanation of how the 'formula' translates in actual practice was clear, so your next animation task becomes easier.

Finally! I was not sure what was the purpose of "bias". In my English-Spanish dictionary that word make no sense to me in "Flight Simulator English", now I know -at least- how to use it. Thank you Fr. Leaming, this thread is saved in my HD!
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
Finally! I was not sure what was the purpose of "bias". In my English-Spanish dictionary that word make no sense to me in "Flight Simulator English", now I know -at least- how to use it. Thank you Fr. Leaming, this thread is saved in my HD!
You are most welcome. I mentioned that the specific example does not require a "scale" because we want to have the sim use all of the frames, not just the ones that are keyed.

If we needed to script a kohlsman knob to rotate continuously around a 360º arc, we'd need to add a "scale" parameter to the <Code> entry:
Code:
      <Parameter>
        <Code>(A:KOHLSMAN SETTING MB, inHg) 28 - 300 * dnor</Code>
      </Parameter>
In this case we wind up with simvar bias - scale *
We would also need to "normalize" the calculation by adding a "dnor" (degrees normalization).
 
Top