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

Element with dual rotation

Messages
95
Country
malta
Hi,

I'm trying to make an element that rotates on its own axes and about another point.

Basically, it must have two rotations with 2 different axes.

How can I do this?

regards
 
You need to be more specific. XML or C?

In either case, the secondary rotation must be a child of the parent rotation. The specific details of how to accomplish this depends on which "language" one is using.
 
hey n4gix,

thanks for your reply.

I'm using XML for FSX.

I tried to rotate the main element around an axis and the child element around another axis but it didn't work.

Any hints?

regards
 
Last edited:
Try:
Code:
<Element>
  <Position X="58" Y="57"/>
  <Element>
    <Position X="58" Y="57"/>
    <Image Name="xxx.bmp">
      <Axis X="35" Y="36"/>
    </Image>
    <Clip/>
    <Rotate>
      <Value>*some variable*</Value>
    </Rotate>
  </Element>
  <Rotate>
     <Value>*some variable*</Value>
   </Rotate>
</Element>
 
hey n4gix,

thanks for your reply, however, I had the same result. it won't rotate the whole element and it's sub-elements independantly....

sub-element rotated with it's own, 1 rotation.

regards
 
“I'm trying to make an element that rotates on its own axes and about another point.

Basically, it must have two rotations with 2 different axes.”

I’m not entirely sure what you’re trying to accomplish, but it reminds me of the calibration screws I use on some of my gauges. Maybe the following code will help:

Code:
<Gauge Name="amps" Version="1.0">
  <Image Name="amps_bak.bmp"/>

<Element>
  <Position X="256" Y="338"/>
    <Image Name="amps_needle.bmp" PointsTo="North">
     <Axis X="8" Y="191"/>
    </Image>
    <Rotate>
       <Value Minimum="-30" Maximum="30">
          (A:Electrical Battery Load,amps)
       </Value>
       <Failures>
          <SYSTEM_ELECTRICAL_PANELS Action="0"/>
       </Failures>
       <Nonlinearity>
         <Item Value="-30" Degrees="-135.0"/>
         <Item Value="0" Degrees="-90.0"/>
         <Item Value="30" Degrees="-45.0"/>
       </Nonlinearity>
      <Delay DegreesPerSecond="180"/>
    </Rotate>
   <Rotate>
      <Value>(L:ampsadj,degrees) 120 / -0.075 max 0.075 min</Value>
  </Rotate>
 </Element>

<Element>
    <Position X="256" Y="413"/>
     <Image Name="ampsadj.bmp" PointsTo="East">
        <Axis X="29" Y="29"/>
     </Image>
     <Rotate>
        <Value>(L:ampsadj, degrees) 3.75 / -2.5 max 2.5 min</Value>
     </Rotate>
  </Element>

<Mouse>
<Area Left="0" Top="0" Width="512" Height="341">
    <Tooltip>Ammeter (%((A:Electrical Battery Load,amps))%!d! Amps)</Tooltip>
</Area>

<Area Left="200" Top="360" Width="110" Height="110">
   <Tooltip>Adjust Pointer (%((L:ampsadj, degrees) 3.75 / -2.5 max 2.5 min )%!3.1f! Amps)</Tooltip>
  <Cursor Type="Hand"/>
 <Click Kind="LeftSingle+RightSingle+MiddleSingle" Repeat="Yes">
(M:Event) 'LeftSingle' scmp 0 == if{ (L:ampsadj,degrees) -- 0.075 min (&gt;L:ampsadj,degrees) } (M:Event) 'RightSingle' scmp 0 == if{ (L:ampsadj,degrees) ++ -0.075 max (&gt;L:ampsadj,degrees) } (M:Event) 'MiddleSingle' scmp 0 == if{ 0 (&gt;L:ampsadj,degrees) }</Click>
</Area>

  </Mouse>
</Gauge>

See the attached image for the lowdown on what moves what; the adjustment screw movement is independent of the normal pointer movement driven by “A:Electrical Battery Load”, it simply offsets the pointer a small amount in either direction.
 
Last edited by a moderator:
Hi proptrash,

thanks for your reply.

Actually, if I understood correctly, what you did was rotation about a single axis
but with 2 different variables. Even though this was important to know, what I want is an element that rotates on itself and around another axis with the same variable.

See pics below.

stat1cl.jpg

stat2s.jpg
 
Hi proptrash,

thanks for your reply.

Actually, if I understood correctly, what you did was rotation about a single axis
but with 2 different variables. Even though this was important to know, what I want is an element that rotates on itself and around another axis with the same variable.

See pics below.



 
“Actually, if I understood correctly, what you did was rotation about a single axis but with 2 different variables.”

It does rotate on itself (the adjustment screw when you left click, right click, or middle click), and it also causes the pointer to rotate at the same time – using the same variable (L:ampsadj,degrees). This occurs independently of the normal movement caused by (A:Electrical Battery Load,amps).

“Even though this was important to know, what I want is an element that rotates on itself and around another axis with the same variable.”

I looked at your drawings, and while I’m still mystified as to what you’re up to, I think you could accomplish it by having two Rotation objects inside the same element - which is what Bill posted - and a variation of that is what I use to move the amp pointer with the adjustment screw:

Code:
<Element>
  <Position X="256" Y="338"/>
    <Image Name="amps_needle.bmp" PointsTo="North">
     <Axis X="8" Y="191"/>
    </Image>
    <Rotate>
       <Value Minimum="-30" Maximum="30">
          (A:Electrical Battery Load,amps)
       </Value>
       <Failures>
          <SYSTEM_ELECTRICAL_PANELS Action="0"/>
       </Failures>
       <Nonlinearity>
         <Item Value="-30" Degrees="-135.0"/>
         <Item Value="0" Degrees="-90.0"/>
         <Item Value="30" Degrees="-45.0"/>
       </Nonlinearity>
      <Delay DegreesPerSecond="180"/>
    </Rotate>
   [B]<Rotate>
      <Value>(L:ampsadj,degrees) 120 / -0.075 max 0.075 min</Value>
  </Rotate>[/B]
 </Element>

Edit: I attached a couple of gauges to this, an OAT and the ammeter. Left click or right click on the screws to move the pointers, middle click to reset.

Not precisely what you're after, but it should give you some ideas.:)
 
Last edited by a moderator:
Note that all I've done is add an <Axis...> tag for the parent <Element>.

Code:
<Element>
  <Position X="nn" Y="nn"/>
  <Axis X="nn" Y="nn"/>   // axis #1
  <Element>
    <Position X="nn" Y="nn"/>
    <Image Name="xxx.bmp">
      <Axis X="nn" Y="nn"/>  // axis #2
    </Image>
    <Clip/>
    <Rotate>
      <Value>*some variable*</Value>
    </Rotate>
  </Element>
  <Rotate>
     <Value>*some variable*</Value>
   </Rotate>
</Element>
 
This thread is a little old, but I have not been on these forums for some time, and am returning to my hobby of gauge programming, so here I am again.

I needed a similar functionality in my EFD100 gauge. Particularly, the compass rose labels (N, S, E, W, ect) rotated around the compass ring while staying upright.)

I tried to use multiple rotations to accomplish this, without any luck. I ended up using to shifts to make the labels travel in a circular path, without any rotations (so the text would always be upright.

This approach doesn't yield a true circle however, it is more of a polygon path. I used non-linear table entries to shift on both the x and y axis. I made a table entry every 10 degrees of the circle, creating a 36 sided polygonal path.

When the label move from say 0 degrees to 10 degrees, it actually travels in a straight path, rather than an arc. The compass rose was small enough in my gauge that this isn't at all noticeable, and if you didn't know, you woudln't notice, I don't think you can notice even if you do know.

It did bug me having to resort to this "imperfect" approach, but it works.

The gauge is written using the ACE tool, and is posed on AVSIM if you wan't to check it out. The labels are nested in "Screen > Navigation > 360 Compass > Rotating Labels".
 
Hello. Was looking into this but the above code (with filled in with the proper parameters) by #10 gives an error of: End tag 'Element' does not match the start tag 'Image'. Oops, sorry. Forgot something... It works. The reason I accessed this thread is I'm trying to resolve this:
 
Last edited:
Back
Top