• 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.

Nonlinearity coordinates in reference to what?

Messages
64
Country
us-vermont
I'm studying some xml code right now so that I can get started on my gauges and to start I am making an EPR gauge, it is a bit more complicated because in addition to the needle, it has a drum-type indicator for the same information. Anyways in the xml I am trying to understand and apply, I see tables that include nonlinearity and they seem to be the locations of the values for the needle to point to. How would one go about finding these coordinates that hold the value for the needle to point to? Thanks.
 
You can do that in Photoshop (and likely GIMP as well) by hovering the cursor over the index mark for some value and writing down the x,y coordinates. All coordinates are referenced to the top left corner of the background image, which means they are always positive numbers.
 
Here's some code for a needle in a round gauge (minus the bitmap name for the needle and the code driving it, as these are irrelevant in this context).
I also can't post the associated bitmaps since they are from a payware gauge.

FloatPosition - Position of the axis on the background bitmap
Axis - Position of the axis on the needle's bitmap
PointsTo - Defines the starting point for the offset angles; in this case north = up; you can also set this to east, south or west, but it'll make things more complicated
NonLinearityEntry - Pairs the result of the evaluation of the script (i.e. gauge variable or mathematical operation) to an offset angle from the intial starting point

Depending on the layout of the needle bitmap (pointing up, down, left, right, etc.), you might have to work with angles that may seem fairly illogical.

In my example, the needle bitmap is pointing right (i.e. O===> ) by default, but since I defined "north" (=up) as the 0° position, I'll have to rotate the bitmap by 62° around the axis to make it point to the "0" position on the background bitmap.
Since the positions on the background are fairly evenly spaced, I can get away with incrementing the rotation angle by 30° for every 10 increments in the expression result.

Code:
<Element>
<FloatPosition>88,90</FloatPosition>
<Image Name="[bitmap].bmp">
<Luminous>True</Luminous>
<Axis>29,30</Axis>
</Image>
<Rotation>
<PointsTo>NORTH</PointsTo>
<Expression>
<Minimum>0.000</Minimum>
<Maximum>100.000</Maximum>
<Script>[some code]</Script>
</Expression>
<NonlinearityTable>
<NonlinearityEntry><ExpressionResult>000.000</ExpressionResult><Degrees>062</Degrees></NonlinearityEntry>
<NonlinearityEntry><ExpressionResult>010.000</ExpressionResult><Degrees>092</Degrees></NonlinearityEntry>
<NonlinearityEntry><ExpressionResult>020.000</ExpressionResult><Degrees>112</Degrees></NonlinearityEntry>
<NonlinearityEntry><ExpressionResult>030.000</ExpressionResult><Degrees>142</Degrees></NonlinearityEntry>
...
<NonlinearityEntry><ExpressionResult>100.000</ExpressionResult><Degrees>312</Degrees></NonlinearityEntry>
</NonlinearityTable>
</Rotation>
</Element>
 
Björn

Thanks for this head up.

Tip By Doug Dawson:
Non-linearity tables, as read from top to bottom, must always describe clockwise motion, even if the natural motion of the needle is counter-clockwise.
 
Okay, here's an example of a non-linearity table that uses absolute x,y pixel positions instead of angles. The coordinates are where the tip of the needle would 'point to' on the background scale:
Code:
  <Element>
    <Position X="121" Y="121"/>
    <Image Name="C310_Left Needle.bmp">
      <Axis X="11" Y="12.5" PointsTo="East"/>
    </Image>
    <Rotate>
      <Value Minimum="0" Maximum="155">(A:ENG FUEL FLOW PPH:1, pph) 8 *</Value>
      <Delay ValuePerSecond="25"/>
      <Nonlinearity>
        <Item Value="0" X="38" Y="32"/>
        <Item Value="50" X="127" Y="0"/>
        <Item Value="75" X="200" Y="32"/>
        <Item Value="100" X="235" Y="91"/>
        <Item Value="110" X="238" Y="136"/>
        <Item Value="120" X="221" Y="184"/>
        <Item Value="130" X="182" Y="225"/>
        <Item Value="140" X="129" Y="240"/>
        <Item Value="150" X="66" Y="228"/>
        <Item Value="200" X="36" Y="208"/>
      </Nonlinearity>
    </Rotate>
  </Element>
 
No. For 3D gauges, you'll have to write code that converts a variable value to a keyframe value.
 
Back
Top