Game Development Community

Fighter Jet HUD

by Nathan Bowhay - ESAL · in Torque 3D Professional · 08/11/2011 (11:17 am) · 2 replies

I want to create a HUD much like that found in a fighter jet that behaves the same way as well. I am using Torque3D although that is sort of irrelevant, but figured I would let you know just in case.
I am making it look sort of like this: www.anft.net/f-14/f14-detail-cp-d-pilot-02.htm

I have most of the elements done (Airspeed, altitude, heading...), except for heading line and that entire center part. This is the part I need help on.

First I am trying to figure out exactly how it behaves and then how to replicate that behavior in my game. I have been watching
to see how it works, and it appears as if that entire element of the gui stays with the horizon and is rotated with it as well. 0 is of course at the horizon itself and the flight path marker is according to the direction the nose is headed.

Please correct me though if you understand different behavior.

So how exactly would I go about writing this. I need to figure out where the horizon is relative to the screen position I guess? So I first need to calculate the position of the horizon and then transform that to screen space (I know how to do that second part). Any idea how to do the first?

Any help would be greatly appreciated, and if someone knows of a code example some place (open source flight sim or something with a working HUD), that would be even better.

Thanks for the help in advance.

PS: Here is a game example from F-22 Lightning II, although the behavior seems a little different I think it would suffice

#1
08/11/2011 (2:05 pm)
As I've programmed a HUD for work project before the idea behind the horizon line indicator is that it is centered vertically and flat horizontally when your aircraft has no tilt or zero degree pitch, a single line drawn at the top of the screen with -90 reading when the nose is down or near -90 pitch, and opposite for nose up or near +90 pitch of which is typically detected using both gyros and accelerometers within an Inertial Measurement Unit on a real aircraft or R/C air vehicle. So, nothing too complicated for a simulator as you can easily get the vehicle's pitch.

Best way to think of a horizon line HUD indicator is to look at an analog clock and say 3 is zero pitch, 12 is +90 pitch, and 6 is -90 pitch. And that your pilot's point of view is pointing towards the numbers from a clock hand, and when you move the clock hand it is the one changing the point of view while the horizon lines are the ones static. But of course when you draw the lines you'll be moving them up and down within the drawing canvas of the HUD.

The horizon lines of course rotate clockwise upon counterclockwise roll and rotate counterclockwise upon aircraft clockwise roll to again present a static visual location of the horizon in relation to the aircraft.

Hopefully this little information helps you out as I've typed this up in a hurry since I'm a bit busy with work at the moment. :)
#2
09/27/2011 (3:56 pm)
Cool thanks for the information! I know how it is when your at work and want to help, I have been in that situation many a time. I pretty much have it all done, but I am running into an issue getting the roll. None of the Angle axis (standard torque transform rotation) to Euler/roll pitch yaw functions are working and I can't seem to the Roll correctly. I posted about it here: www.garagegames.com/community/forums/viewthread/127484

Figured you may be able to help since you probably had to do the same thing. If you need a video or something of what is going on exactly or more info let me know.