Menu

#38 Point camera between plane and horizon, and use "life-size" zoom. (includes patch as example)

open
nobody
None
5
2020-08-31
2020-08-31
Joe Doe
No

I was trying to practice landing and often couldn't see the runway I was trying to land on. So I made some modifications that I think improve on the default camera behavior.

Unfortunately this isn't a ready-to-use patch, as I don't know how I'd go about putting stuff in the GUI or even where this code properly belongs, but it implements what I wanted (and what I imagine other people might like) and I assume someone who knows the existing code better can figure out how to make this a proper feature easily enough. So I'm just sending this patch as a demo.

This code does a few things:

  1. Aims to keep both the horizion and the plane on the screen, and mostly points the camera between them, so that the player has some reference for which direction they're facing and where the runway they're trying to land on is.

  2. Implements "life-size zoom" as the maximum zoom level. Thus, if in real life the plane would be so far away that you can barely see it, it'll be so small on the screen that you can barely see it. I feel like this is an important thing for practice, as it both forces me to learn to keep the plane close enough that I'll be able to see it, and how to control it when it gets so far away that I can't see it well. This life-size zoom will be different for every user, so achieving it requires that the user measure the height of their monitor and the distance between it and their eyes.

  3. Implements a maximum zoom-out level, so that if the plane is high enough such that you're looking upwards enough, then you lose sight of the horizion, as you would in real life.

After using this mod for a few days though, I realized I'd rather not have it zoom at all, given that it was kind of unnecessary with the camera now being aimed between the plane and the horizion. I feel like this is more helpful for practice since the scale of what I'm seeing is always the same as it would be in real life. However, I left the code that zooms out to keep the horizion in view in there since I imagine others might want it.

The configuration variables are just these #define located in the patched file:

#define HEIGHT_OF_SCREEN 13.25  // use any units you like, just
#define DISTANCE_TO_SCREEN 40   // use the same units for both

#define MINIMUM_VIEW_OF_HORIZION  5  // How far above & below horizon we always want to be able to see, in degrees.
#define MINIMUM_VIEW_ABOVE_PLANE  1  // How far above the plane we always want to be able to see, in degrees.
#define MINIMUM_VIEW_BELOW_PLANE 10  // ...because seeing below the plane, where ground may be, is more important.

#define MAXIMUM_FIELD_OF_VIEW   0  // The maximum zoom-out, in degrees.  Set to 0 to disable zooming.

You'll at least want to input your own measurements for HEIGHT_OF_SCREEN and DISTANCE_TO_SCREEN. Note that the calculation is based on the actual window size, and so the smaller you make your window, the smaller field of view you'll get, so that things continue to be life-size. So be sure to maximize your window. Also, if you have multiple monitors arranged vertically then the HEIGHT_OF_SCREEN probably needs to be the total height.

You'll also want to disable the automatic zoom, smart camera and sloppy camera features, as I don't know how they interact with what my hack does. They may give it the wrong impression of where the plane is since I don't think I'm getting that from the correct variables.

If you want it to zoom out when the plane is high in the sky, so that it continues to show some of the horizion, then 60 to 120 might be a good value for MAXIMUM_FIELD_OF_VIEW.

The other three values I think are fine as-is, but there's no accounting for personal preference, so change them if you like. Just be aware that the life-size field of view is probably going to be only 20 to 40 degrees, unless you sit very close to your monitor, and so if you configure it to see 30 degrees above and below the horizion (60 degrees total) then that's just not going to happen unless you increase the maximum field of view, and in that case you're never going to see a life-size rendering.

1 Attachments

Discussion


Log in to post a comment.