Jump to content
Sign in to follow this  
Guest fatcharlie

Whiskey Compass from a different perspective

Recommended Posts

Guest fatcharlie

Hi all,I am trying to replicate a Sila-type compass (one which has a horizontal compas card, not a vertical one - picture attached)...... and have come across a problem.here's my code:<Gauge Name="Silva_Compass" Version="1.0"> <Image Name="Silva_Background_Real.bmp" ImageSizes="600,600"/> <Element> <MaskImage Name="Silva_Small_Mask.bmp" ImageSizes="600,600"> <Axis X="300" Y="500"/> </MaskImage> <Position X="0" Y="0"/> <Image Name="Silva_Small_Ring.bmp" ImageSizes="600,600"> <Axis X="300" Y="300" PointsTo="East"/> </Image> <Rotate> <Value>(A:Wiskey compass indication degrees, radians) </Value> </Rotate> </Element> <Element> <MaskImage Name="Silva_Large_Mask.bmp" ImageSizes="600,600"> <Axis X="300" Y="25"/> </MaskImage> <Position X="0" Y="0"/> <Image Name="Silva_Large_Ring.bmp" ImageSizes="800,800"> <Axis X="400" Y="400" PointsTo="East"/> </Image> <Rotate> <Value>(A:Wiskey compass indication degrees, radians) </Value> </Rotate> </Element> <Mouse> <Tooltip ID="TOOLTIPTEXT_WHISKEY_COMPASS"/> </Mouse></Gauge>What I am doing is having two separate, vertical, compass cards, masked so that only a portion of each one is showing. This gives an optical illusion which is similar to the 'ellipse we see when looking at a horizontal card on this type of compass. The top of one card shows as the back of the elipse, the bottom of another shows the front of the elipse (image attached)...All is good, except that it goes the wrong way!I know to reverse the rotation I must introduce a Nonlinearity table (thanks Nick), but I do not know the values. A full circle is 2*pi radians, so I tried 0 to 6.284, but everything went crazy!I have tried degrees, as in: <Value>(A:Wiskey compass indication degrees, degrees) </Value>and: <Value>(A:Wiskey compass indication degrees) </Value>... and then introducing the following nonlinearity table (The bitmap is 600 x 600): <Nonlinearity> <Item Value="360" X="300" Y="10"/> <Item Value="315" X="90" Y="90"/> <Item Value="270" X="10" Y="300"/> <Item Value="225" X="90" Y="510"/> <Item Value="180" X="300" Y="590"/> <Item Value="135" X="510" Y="510"/> <Item Value="90" X="590" Y="300"/> <Item Value="45" X="510" Y="90"/> </Nonlinearity> This didn't work. There are four permutations of the data here - the X and Y co-ordinates can run from top to bottom or be reversed, and the Values can do the same.I've tried all of them but to no avail.I am clearly missing something obvious! But what?Many thanks in advance,Roger.

Share this post


Link to post
Share on other sites

Try:

<Value>(A:Wiskey compass indication degrees,degrees) /-/</Value>


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest fatcharlie

Thanks Bill.Tried that, it locked the two bitmaps upright.Then I tried:<Value>(A:Wiskey compass indication degrees,degrees) /-/</Value>The gauge appeared, but the bitmaps didn't!Eventually I tried:<Value>(A:Wiskey compass indication degrees,radians) /-/</Value>Works a treat! Finally.Thanks so much for the guidance.All I have to do now is to work out how to lay a semi-translucent bitmap ove the front of the compass to simulate the perspex dome, and I'll be happy!I think I understand how to produce the bitmap with the Aplpha Channel (although how an 8-bit, greyscale image retains the information I don't know), but I'm not sure of the syntax or Element descriptions to use - Alpha="yes", Translucency="0.2" or suchlike, in the xml file.As Benny Hill used to say - learning all ze time!Cheers,Roger.

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...