Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Rotate bitmap with bank angle

Featured Replies

Hi Gurus,Suppose I want a bitmap what rotates with the bank angle of the aircraft, like something on a wire/string like on the inside rearview mirror seen on cars.I found it very complicated, looking at how some gauges with rotating bitmaps do it, and I am totally clueless on how to start.Can you guide me to the light?Johan

Edited by Johan_Dees

Hi,Work on this one:

<Element><Position X=".." Y=".."/><Image Name="yours.bmp"><Axis X=".." Y=".."/></Image><Rotate><Value>(A:Attitude indicator bank degrees,radians)</Value></Rotate></Element>

<Position X=".." Y=".."/> : position of center of bitmap "yours" somewhere on the panel.<Axis X=".." Y=".."/> : center of rotation of that bitmap.Fette beute!

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Author

yes!, works well, I added after studying other gauges / - /like:

<Value>(A:Attitude indicator bank degrees,radians) / - / </Value>

so it swings like a g-force effect.Thanks!

  • 2 months later...
  • Author

this works well.

Can I use a whole gauge in stead of a bitmap only also to do this or does every gauge item be coded seperatly for this ?

Yes you can!

 

But.....

You need to have the background bitmap in the gauge, not in the panel folder.

Here is the code i use to pull the HUD in the pilot's sight.

 


<Gauge Name="hud" Version="2.0">

<Element>
<Element>
<Position X="0" Y="40"/>
<Visible>(L:hud frame up,bool)</Visible>
<Select>
<Value>(L:capt instr bus AC volts,number) 100 > if{ (L:Flood,enum) (A:LIGHT PANEL,bool) 4 * + } els{ 0 }</Value>
<Case Value="0"><Image Name="hud frame up lv.bmp"/>			   </Case>
<Case Value="1"><Image Name="hud frame up lv.bmp"/>			   </Case>
<Case Value="2"><Image Name="hud frame up lv.bmp"/>			   </Case>
<Case Value="4"><Image Name="hud frame up lv.bmp"/>			   </Case>
<Case Value="5"><Image Name="hud frame up lv.bmp"/>			   </Case>
<Case Value="6"><Image Name="hud frame up lv.bmp" Luminous="Yes"/></Case>
</Select>
</Element>
<Shift>
<Value Minimum="0" Maximum="1">(L:hud frame up,bool)</Value>
<Nonlinearity>
<Item Value="0" X="0" Y=   "0"/>
<Item Value="1" X="0" Y="-120"/>
</Nonlinearity>
<Delay PixelsPerSecond="50"/>
</Shift>
<Shift>
<Value Minimum="0" Maximum="1">(L:hud frame up,bool)</Value>
<Nonlinearity>
<Item Value="0" X=   "0" Y="0"/>
<Item Value="1" X="-120" Y="0"/>
</Nonlinearity>
<Delay PixelsPerSecond="50"/>
</Shift>
</Element>

....
rest code
....

 

After pushing (>L:hud frame up,bool), the frame vanishes in the left upper corner.

 

Mind the 2 elements.

The movement is in the shift parts, ignore the rest, sure you can pull something useful out of it.

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Author

http://www.flickr.co...ulcan/94730012/

 

what I want to make is 2d version of the compass what swings a little. Your first code let me do this, but to have a gauge doing it is something different.

Your second code does something different I think ?

 

<?xml version="1.0" encoding="utf-8"?>
<Gauge Name="magnetic_compass" Version="1.0">
<Image Name="magnetic_compass_background.bmp"/>
<!-- ======================= Compass Strip ======================= -->
<Element>
	<Position X="21" Y="26"/>
	<MaskImage Name="magnetic_compass_window.bmp">
		<Axis X="32.5" Y="0"/>
	</MaskImage>
	<Image Name="magnetic_compass_strip.bmp">
		<Nonlinearity>
			<Item Value="0" X="294" Y="0"/>
			<Item Value="360" X="50" Y="0"/>
		</Nonlinearity>
	</Image>
	<Shift>
		<Value>(A:Wiskey compass indication degrees,degrees) dnor</Value>
	</Shift>
</Element>
<!-- ======================= Tick Marks ========================= -->
<Element>
	<Position X="51" Y="27"/>
	<Image Name="magnetic_compass_line.bmp"/>
</Element>
<!-- ======================= Shadow ============================= -->
<Element>
	<Position X="0" Y="0"/>
	<Image Name="magnetic_compass_shadow_alpha.bmp" Alpha="Yes"/>
</Element>
<!-- ======================= Highlight ========================== -->
<Element>
	<Position X="0" Y="0"/>
	<Image Name="magnetic_compass_highlight_alpha.bmp" Alpha="Yes"/>
</Element>
<Mouse>
	<Tooltip ID="TOOLTIPTEXT_WHISKEY_COMPASS"/>
</Mouse>
</Gauge>

 

So to let the whole gauge swing left or right I can use:

 

<Gauge Name="Baum" Version="1.0">

 <Element>
<Position X="238" Y="136"/>
	   <Image Name="Baum.bmp">
  <Axis X="160" Y="0"/>
	</Image>
<Rotate>
  <Value>(A:Attitude indicator bank degrees,radians) /-/ </Value>
</Rotate>
<Shift>
  <Value>(A:Attitude indicator pitch degrees:1,degrees) /-/ </Value>
  <Scale Y="0.8"/>
</Shift>
  </Element>
</Gauge>

 

This what I used to swing a wonderbaum in front of the windshield.

 

Now, how to combinde those two ?

 

Since this is higher XML, I probably need your knowledge and skill to do this, since I have no idea where to start on this, if possible.

 

Johan

Hi,

 

Not tested, but try:

 

<?xml version="1.0" encoding="utf-8"?>
<Gauge Name="magnetic_compass" Version="1.0">  
<Element>
<Element>
<Image Name="magnetic_compass_background.bmp"/>
</Element>
<!-- ======================= Compass Strip ======================= -->	  
<Element>			  
<Position X="21" Y="26"/>			  
<MaskImage Name="magnetic_compass_window.bmp">					  
<Axis X="32.5" Y="0"/>				</MaskImage>			  
<Image Name="magnetic_compass_strip.bmp">					  
<Nonlinearity>							  
<Item Value="0" X="294" Y="0"/>							  
<Item Value="360" X="50" Y="0"/>					  
</Nonlinearity>			  
</Image>			  
<Shift>					  
<Value>(A:Wiskey compass indication degrees,degrees) dnor</Value>			  
</Shift>	  
</Element>	  
<!-- ======================= Tick Marks ========================= -->	  
<Element>			  
<Position X="51" Y="27"/>			  
<Image Name="magnetic_compass_line.bmp"/>	  
</Element>	  
<!-- ======================= Shadow ============================= -->	  
<Element>			  
<Position X="0" Y="0"/>			  
<Image Name="magnetic_compass_shadow_alpha.bmp" Alpha="Yes"/>	  
</Element>	  
<!-- ======================= Highlight ========================== -->	  
<Element>			  
<Position X="0" Y="0"/>			  
<Image Name="magnetic_compass_highlight_alpha.bmp" Alpha="Yes"/>	  
</Element>
<Rotate>		
<Value>(A:Attitude indicator bank degrees,radians) /-/ </Value>	  
</Rotate>	  
<Shift>		
<Value>(A:Attitude indicator pitch degrees:1,degrees) /-/ </Value>		
<Scale Y="0.8"/>	  
</Shift>
</Element>
<Mouse>			  
<Tooltip ID="TOOLTIPTEXT_WHISKEY_COMPASS"/>	  
</Mouse>
</Gauge>

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.