Download

Calculating zoom levels

I’ve added a set of binoculars to my game, works fine. But I got to thinking. Currently I just zoom in between my default FOV and some minimum FOV (i.e. max zoom level). But I really want to say what magnification level I’m using. So if my default FOV is 1.0, what would be the zoom level at any given FOV value?

So imagine I start my FOV at say 70 degrees and I zoom it up to say 20 degrees, what is my current zoom level if we assume 70 degrees is 1.0x zoom?

Its not a linear relationship is it?

My head is mush right now (long day) so if anyone can give a few braincells to think this through for me, that would be super nice :slight_smile:

Ta.

The FOV zoom is also going to be affected by screen resolution and aspect ratios. The FOV is eventually fed into a DirectX projection matrix. You could try to empirically try to guesstimate the apparent magnification level, but it’s probably not going to be 100% accurate.

If I was you, I’d just fake it. Set a few different FOV’s for zoom, and then just tell the user that they’re looking at a 1.5x zoom, 2.0x zoom, 4x zoom, etc. As long as its believable, who cares? That kind of detailed accuracy isn’t going to cause players to get super angry and write hate mail to you. This frees you move on to more important game play details :wink:

I worked on that for weapon optics in the past and I think there is no way to do this mathematically correct due to the FOV/ViewFrustum/ScreenResolution relationship. Zoom/Magnification in real life works like this:
1249c629c170398fa4d2e0fbdc001985badb4c57.jpeg
So the visible screen area for each step is 1/4 of the previous step.

What I did was just simply take a screenshot like the one above with my default FOV and called it 1x. then I photoshopped an 8x area into it and tried to find an FOV that would represent exactly that ingame.
From here on you have a linear relationship that kinda works for your game and you can calculate all other magnifications using simple rule of three calculations.

So faking it is the easiest solution, since nobody will ever see the difference.

So what you’re basically saying is “guesstimate it” :slight_smile:

I don’t know how you could even suggest such an improper method :slight_smile:

Ok, I guess its not worth me really thinking about, given I’m about to pass out asleep :slight_smile: