Archived

This topic is now archived and is closed to further replies.

Guest fatcharlie

Whiskey Compass from a different perspective

Recommended Posts

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
Help AVSIM continue to serve you!
Please donate today!

Try:

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

Share this post


Link to post
Share on other sites

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