Jump to content
  • Advertisement
Sign in to follow this  
Sword7

HUD algorithms for glass HUD/MFD window

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Folks,

 

Does anyone know any HUD algorithms like pitch ladder, compass tape, direction, velocity vector, etc for writing flight simulators? I was looking for them through google and books but did not found information so much. That's why I am looking for OpenGL-based HUD drawing routines for glass HUD display and MFD window.

 

Thanks,

Tim Stark

 

Share this post


Link to post
Share on other sites
Advertisement

Just figure out what the elements you want are, and design them out on paper, and start working out how to generate shapes that depict that. A compass tape, for instance. You want vertical lines, of varying heights. Assume model-space 0,0 is the center of the tape, take as input the bearing and desired width (in degrees) to include notches for and let some parent function deal with the position and size of the tape on the HUD (by setting the modelview matrix appropriately).

 

You'll want to use the the fractional part of the bearing as a horizontal bias for the notches, and then generate several notch lines left and right of center, all of them offset by the bias. If you use integer modulo tests to determine whether to use a short or tall notch, you should probably add 360 to your bearing first, because most languages' modulo operator doesn't treat negative numbers correctly.

 

If you do it right, it should be configurable and controllable by *any* simulated data. You should be able to make a test viewer where you set the "flight" parameters in a GUI form using text boxes and numeric sliders, and see the resulting HUD rendered, without any simulated airplane ever being involved.

Share this post


Link to post
Share on other sites

There is no one true algorithm for any of these. It's also not too complicated to implement.

 

Compass tape is dependent on the facing direction of the camera or plane along the X,Z plane. Doing a bit of vector math after projecting to that plane will do the trick. This requires you to determine which facing direction is North, East, South, and West. And then interpolate between these distances.

 

Velocity Vector is more dependent on the computations from the CPU than the GPU. I'm not going to explain this, because there's literally thousands of different styles to this. I can't guess at what you want.

 

I don't know what you mean by a "Glass" hud. I guess you mean that holographic style where they appear in a see through crystal? If so, then it's two different options. Both of them are about the same. You can render the hud directly to the glass, but it doesn't give you that temporal effect. Or you could try rendering it to a cube map.

Edited by Tangletail

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!