• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Conforming a 2D HUD overlay in the VC

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
 
Messages
137
Country
us-southcarolina
Interesting read, thanks Roy.

Just in case this isn't realised.
If you're wishing to add a HUD to an aircraft MDL that's FSX native. There's a good chance you can merge a HUD from another aircraft in to the VC using ModelConverterX.
I've only tried this once as a test. I think getting it positioned perfectly would be a pain, but otherwise it seems to work fine. Obviously the relative eye-point would need to be the same for the HUD to work as well as in the donor aircraft.

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:
Messages
176
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.
 
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.

WebSimConnect said
Then you look for pixel per degree for small angles and apply it to the shift of the zero pitch line. Please note, fixed pixel per degree will only "work" when angle is small which is a normally in range of HUD pitch ladder. If you want to be more precise, you would need to apply simple trigonometry.

tan (FOVY/2) = (height/2)/adjacent assuming horizon is at the middle of the screen . if not, you need to take it into account.
tan(pitch) = offsetY/adjacent
and from those 2 formulas you can get offsetY value you shoud apply.

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
 
Messages
137
Country
us-southcarolina
All,
Success ! ....sort of...

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
 

WebSimConnect

Resource contributor
Messages
154
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.

tan(48.6/2) = (height/2)/Adjacent (in this case height of what? and Adjacent what ?
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:

IC412711.png


ZFront will be your HUD, ZBack the outside view with horizon when at 0 AMSL.
 
Last edited:
Messages
137
Country
us-southcarolina
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.

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.


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:

IC412711.png


ZFront will be your HUD, ZBack the outside view with horizon when at 0 AMSL.


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
 

Attachments

  • HUD Segment.txt
    14.5 KB · Views: 345

WebSimConnect

Resource contributor
Messages
154
. 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 ?

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).
 
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
 
Top