1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Conforming a 2D HUD overlay in the VC

Discussion in 'Gauges' started by jdhughen, 13 Mar 2017.

  1. jdhughen

    jdhughen

    Joined:
    19 Feb 2017
    Messages:
    137
    Country:
    us-southcarolina
    Thanks for the help everyone. Great post, very informative. I've been out of town for a couple days. Will try all this out this weekend and let you know. I did try both the F-14 and the T-45 and while the VC HUD was dead on for each the 2D HUD didn't act the way and the horizon didn't stay pinned to the sim horizon while under 200' at sea level. I will see if i can make it happen in straight 2D mode then in my desirded config of 2D HUD over the VC. Thanks so much for your help

    Joel
     
  2. jdhughen

    jdhughen

    Joined:
    19 Feb 2017
    Messages:
    137
    Country:
    us-southcarolina
    While for now I just want to get this 2D overlay thing working right, you present an interesting idea. I have used MCX to assist in repaints and convert back to source, just so i could examine UV mapping for aircraft with poor or non existent paint kits. My background in film/video post includes a lot of experience in 3D modeling. So my question is, obviously for personal use only, If one created a HUD poly "plane" in MAX, As Roy describes, placed in 3D Space in the same position/orientation in 3D space as 20m in front of the VC eyepoint (i assume measured from aircraft center or ref datum pos) , mapped it, created HUD material etc, could one then export/compile to a MDL like creating another aircraft MDL and then "merge" it with MCX in the aircraft it was designed to fit??

    Joel
     
    Last edited: 18 Mar 2017
  3. Essex

    Essex

    Joined:
    15 Sep 2013
    Messages:
    94
    Country:
    unitedkingdom
    Yes you could model the HUD from scratch, or isolate the parts from a donor aircraft (as I did).
    When merging with the VC you have the option to adjust the position. Potentially prior to merging you could also rescale the HUD.
     
  4. jdhughen

    jdhughen

    Joined:
    19 Feb 2017
    Messages:
    137
    Country:
    us-southcarolina
    All,
    Success ! ....sort of...
    I was able to find the right scale (of the HUD gauge), alignment and camera zoom to get the 2D HUD conformed over the VC.
    Unfortunately it not at the zoom I prefer for the VC and I would like the gauge larger on the screen. Right now it's the following...
    Screen = 1920x1080
    WideViewAspect=TRUE
    Gauge size 659x725 (BG_ .BMP)

    VC camera zoom = 1.0

    Panel.cfg (relevant entries)
    [Window05]
    window_pos=0, 0
    window_size=1.0, 1.0
    size_mm=1024

    gauge00=HUD_TEST!HUD, 390, 342, 243, 475

    When I use the above settings all is rock solid, but I would much prefer to use the default VC zoom of 0.7 and i would prefer that the HUD be proportionally another 100 pixels taller but could live with this size if i could get the zoom to 0.7.

    When I zoom out at all the HUD instantly loses confomality and the HUD Horizon floats instead of being "pinned". So what kind of math and applied where do I need to use to be able to use a .7 zoom.

    So to use the above do I need to convert the zoom that works "1" to the Zoom that i want "0.7" such that ...
    If WideViewAspect=TRUE then
    Vertical FOV=(34)/Zoom factor ....
    FovY=(34)*.07= 48.6
    then below....
    tan(48.6/2) = (height/2)/Adjacent (in this case height of what? and Adjacent what ?
    Sorry but I just need a clearer picture how to calc this and then where to apply it? Besides the ladder/Horizon ,would this offset need to be applied to all the moving parts? ie Velocity vector, etc

    thanks
    Joel
     
  5. jdhughen

    jdhughen

    Joined:
    19 Feb 2017
    Messages:
    137
    Country:
    us-southcarolina
    UPDATE.... I was able to move the Zoom out to 0.7 BUT... in order for the HUD to still be conformed I had to scale it down more. Since it was originally built and conformed mathematically to work in the VC of the F-18 it seems to want to keep that same size relationship it has in the VC when used as a 2D overlay on the VC which has a default zoom of 0.7. While i can find a way to live with this if I need to I would really like to get it bigger which I assume is going to require some change to the code and or bitmaps. I've looked at the formulas that have been supplied here and on other threads but am not clear on how and where to apply them. Any guidance would be appreciated.

    Thanks
    Joel
     
  6. WebSimConnect

    WebSimConnect Resource contributor

    Joined:
    13 Nov 2013
    Messages:
    105
    locate in your XML code, the pitch ladder element with zero pitch line, post it here, then we might help. Same for Flight Path symbol (for velocity vector). It is clear when you change the original sizing, it needs to be applied in XML code.

    Joel,

    draw a triangle with your eye point and screen in front, then perpendicular line from the screen to your eye and you will see. the formula assumes, the screen is divided by 2 by that line.

    maybe that pic will help understand:

    [​IMG]

    ZFront will be your HUD, ZBack the outside view with horizon when at 0 AMSL.
     
    Last edited: 20 Mar 2017
  7. jdhughen

    jdhughen

    Joined:
    19 Feb 2017
    Messages:
    137
    Country:
    us-southcarolina
    The code is quite extensive and a lot more detailed than the other HUDs I looked at for a base but it's functionality is great. The HUD uses a lot of local vars and macros so since those are used to control all the moving objects I included that part of the code also. The horizon zero pitch line is a BMP by itself, visibility is dependent on Gear Up/DN. Unlike other HUDs I looked at where shift and rotate are applied to each BMP part of the ladder seperately, in this HUD all the BMPs of the ladder are sort of positioned in space along their Y axis within an <Element> and then Shift / Rotate / Shift X /Shift Y, with the exception of Rotate the shift values are based on Lvars calculations. It's quite a lot of code but i think to need all these parts to see what he's doing. I'm hoping I can apply and offset value in someplace in the macros and it will trickle down to all the parts. The first Shift and Rotate seem pretty straight forward and if i know how much to scale to get where I want to be.

    I can't insert the code in a window cause it's too big. And it won't let me attach an XML file so I've changed it to TXT so i can add it. Just change it to .XML . The segment of the code only cantains the Lvar and macro sections and the moving part (ie ladder parts, VelVector, Waterline, ILS lines, steering, AoA, etc.


    The HUD is conformal at a zoom of 1 in the VC and a 2D panel config placement of gauge00, 390, 340, 243, 475. It is also conformal at a VC zoom level of 0.7 with 2D HUD scaled down in a panel config placement of gauge00, 419, 378, 195, 380. What i want is to keep the VC zoom level of approx 0.7 but be able to use the 2D HUD at the scale of at least gauge00, 390, 340, 243, 475
    I just need some guidance on how to change it.



    I see what your talking about.
    So i assume this would be based on the view of the modeled HUD in the VC of the F-18 ? There is no "distance" D with a 2D gauge displayed in the VC. Are we going to need to know the value of "D" above or do we solve for "D" ? to measure the distance from the eyepoint to the HUD Glass in the VC I would have to go thru MCX here I can measure it ?

    Joel
     

    Attached Files:

  8. WebSimConnect

    WebSimConnect Resource contributor

    Joined:
    13 Nov 2013
    Messages:
    105
    You calculate D (it is Adjacent in my previous formulas) based on the FOVY and height of the viewport. Then having D, you can calculate offset Y for each angle (pitch).
     
  9. jdhughen

    jdhughen

    Joined:
    19 Feb 2017
    Messages:
    137
    Country:
    us-southcarolina
    Just an update....
    I was never able to figure how to, or i should say where to apply any offsets in the existing code structure to get the HUD conformal at my original desired zoom level. The math and the script structure of the macros were just over my current abilities decipher on my own so i looked for other avenues. Since then I found an earlier version of the same basic XML HUD I wanted to use as a base. This one uses BMPs that are a little larger and it renders a little larger when confromed at zoom level of 1. I read many of the articles and tuts about screen/display zoom level setup for conformality/realism and I have decided to go with a std zoom level of 1.
    I kept all the "moving" parts of the HUD and stripped the rest out and have started adding items around it. It's going slow but sure and I'm happy with what is working. I modified a TrackIR profile to give a large deadzone straight ahead, so as long as I'm looking ahead the HUD is conformal yet i can still look around the VC and outside when needed. For grins I added [tailhook] and [launch_assistance] entries to my Lotus Sim L-39 and am able to do spot on moving carrier landings using this 2D over VC HUD setup, the velocity vector and other vector goodies are all dead on, horizon line stays glued to the sim horizon, heavy crosswind landings no problem in "caged" mode. I'm happy as a clam, feel like I'm cheating, but it's a lot of fun.
    Now to add the parts I want. I did incorporate the use of a aircraft specific .ini file which will make it easier to add the finished HUD any any of my aircraft, (I hope)
    I will post a HUD build update to another thread as the project progresses.

    Thanks for all that chimed in with advice and help.

    Joel
     

Share This Page