General Question Best way to animate a 3d ADI ball

Moach

Crazy dude with a rocket
Addon Developer
Joined
Aug 6, 2008
Messages
1,581
Reaction score
62
Points
63
Location
Vancouver, BC
well, title says all, but a little image always helps clarify, so look:
picture.php



before anything else, let me thank dr. Martin for the great ADI texture :thumbup:

anyways, as you can see, that thing is a ball, an actual 3d sphere with Martins texture wrapped around it :rolleyes:

now i need to make it into a gyro indicator...

my first thought was to have a set of animation to spin it on each XYZ axis... but i'm not sure on how that would correspond to the input coordinates i want displayed... and i don't want a gimbal lock or a non-commutative-operation error messing up my stuff

for as you can see on the glareshield panel, there's a 5-stop knob that selects the following operation modes for the Gyro-ball:

OFF = disabled mode -- i've coded that one already, works perfecly :lol:

PT/BK = Pitch/Bank mode, works exactly like a regular aircraft ADI, you know it...

AFV = Atmospheric Flight Vector -- same as PT/BK but also rotates horizontally to show yaw deviation

ORB = Orbit mode --same as AFV, but orients towards your orbit prograde vector instead

ABS = Absolute direction mode -- locks on to the current attitude (when you press "mark") and shows your deviation from that direction



anyways, i was thinking of using a manual animation to work out the rotation matrix for that thing... but i found the documentation a bit scarce on that matter... should i try that? or should i use parented animations for each gimbal axis?

just looking for pointers... any input however uninsightful is still appreciated :cheers:
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
If you download the most recent orbiter beta, you'll find my code for animating the ADI ball in the Shuttle-A sources. Maybe that helps.

Note that I am using the ADI ball currently in the 2D panel, not in the VC, so before rendering the ball it is projected on a flat surface. If you want to use yours in a VC, simply leave out the projection part.

Note also that the Shuttle-A supports two different ADI modes:
  1. -180 <= pitch <= 180 and -90 <= yaw <= 90
  2. -180 <= yaw <= 180 and -90 <= pitch <= 90
The transformations for the two modes are different, so make sure to pick the one corresponding to your ADI layout.

Edit: Nice cockpit, by the way. What is it?
 

Wishbone

Clueless developer
Addon Developer
Joined
Sep 12, 2010
Messages
2,421
Reaction score
1
Points
0
Location
Moscow
Not to highjack the thread, but the location of the ADI ball is not ergonomic at all. At this height the eye is quickly fatigued.
 

Moach

Crazy dude with a rocket
Addon Developer
Joined
Aug 6, 2008
Messages
1,581
Reaction score
62
Points
63
Location
Vancouver, BC
Not to highjack the thread, but the location of the ADI ball is not ergonomic at all. At this height the eye is quickly fatigued.

well then... it's a backup instrument :rolleyes: it's not there to be the center of attention...

but as the dr. said, since we already have it coded, i could just as well turn it into an MFD, so you could have a projected ADI ball right in front of you :cheers:

thanks again, Martin! :hailprobe:
 
Top