# Fighter Jet HUD

This topic is 2537 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am hoping this is the correct place to post this, feel free to let me know if it isn't or move it if your a mod.

Anyway 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: http://www.anft.net/...-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 [media]
[/media] 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
[media]
[/media]

##### Share on other sites
Calculating the horizon: I think the best solution here would be the cross product of a world space Up vector and the facing vector of the craft.

As for the behaviour of the middle point, it seems to be always pointing towards the launch vector, relative to the craft, of the weapons. I.E. if the pilot fires the machineguns, the rounds will approximately end up in the circular area. When the craft is in an upward or downward loop, it makes sense that the target point would not be visible to the pilot, which is why it goes off display at this point. I imagine that the reticle can be set for different ranges, which will affect how far off display it will be for a given banking velocity.

Just remember, you should be implementing some middle point between what is realistic and what is most fun - to make sure you get the right balance beween flight simulator anoraks and frat boy 360 gamers If its not totally realistic, thats not a disaster.

Disclaimer: I don't know all the correct aviation terms. Don't laugh at me.

##### Share on other sites

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?

The artificial horizon is just a matter of finding the "forward" and "up" vectors of your jet. You grok this from it's orientation matrix/quaternion. Then you just draw the correct rung of the ladder to the center of the screen/hud/whatever. So as an example, you find your forward vector is actually pointed straight along the Y axis (assuming Y is UP!), you would just draw the "+90" rung in the middle.

Then, for the flight path marker, just take your velocity vector and normalize it, then basically plot this against your artificial horizon.

Some HUDs I have seen do funny things with offsetting the artificial horizon with respect to yaw and side slip, so beware of that if you are going to a very realistic effect.

##### Share on other sites
Thank you both for such quick and good answers. This is going to help a ton.

Oh and just as a side note. This actually isn't for a game necessarily, so realism is actually key. It is for a serious game/simulation/visualization application we (ESAL) develop for Boeing. We are contracted by them and it is use with the swarm technology they are working on along with others. So it is all in house and doesn't need to be fun Although these screens are way out of date here's our site if your curious: http://www.esalstudios.org/gallery/

Anyways again thanks a ton for the help.

1. 1
2. 2
3. 3
Rutin
22
4. 4
JoeJ
16
5. 5

• 14
• 30
• 13
• 11
• 11
• ### Forum Statistics

• Total Topics
631774
• Total Posts
3002294
×