Jump to content
Sign in to follow this  
ceeeb

Some facts about zoom and Field of View (FOV) in Arma

Recommended Posts

Hi all,

As you probably know, there are many Arma 3 (and Arma 2, and DayZ) online calculators, guides, videos and tools that provide info on changing the default soldier field of view by modifying the fovTop and fovLeft values in the Arma3Profile config file. I've spent some time working out how field of view in Arma 3 works, and have found that all the references I've seen are very inaccurate (beyond higher fovTop/fovLeft == higher Fov). I'm pretty confident the same infomation applies to Arma2 and DayZ SA, but haven't tested in those games. fovTop and fovLeft have nothing to do with radians, they are magnification divisors (note magnification is not directly proportional to field of view). Both horizontal and vertical field of view vary with aspect ratio, but the magnification remains constant. I've worked this out the hard (stupid) way, so there are a few "magic numbers" in the calculations. Any corrections or simplifications would be welcome. I'll add this to the BI wiki if there are no problems found.

Default soldier field of view:

[table=width: 500]

[tr]

[td]Aspect Ratio[/td]

[td]Horizontal FOV[/td]

[td]Vertical FOV[/td]

[/tr]

[tr]

[td]5:4[/td]

[td]70.22°[/td]

[td]56.18°[/td]

[/tr]

[tr]

[td]4:3[/td]

[td]73.74°[/td]

[td]55.30°[/td]

[/tr]

[tr]

[td]16:10[/td]

[td]83.97°[/td]

[td]52.48°[/td]

[/tr]

[tr]

[td]16:9[/td]

[td]90.000°[/td]

[td]50.625°[/td]

[/tr]

[tr]

[td]21:9 *[/td]

[td]106.26°[/td]

[td]44.83°[/td]

[/tr]

[/table]

Note: The "21:9" aspect ratio is truthfully 64/27, default fovTop/fovLeft ratio != 21:9

Method of calculation:

This was my original method which was effective, but slow, relied on the player looking at the ground and was not very precise:

  1. Left and right edges of screen are found using safeZone commands.
  2. These screen positions are converted to world positions using screenToWorld command.
  3. Viewpoint world position is found using positionCameraToWorld.
  4. Lengths of the 3 sides of triangle screenLeft, cameraPos, screenRight are calculated.
  5. Angle screenLeft, cameraPos, screen right calculated using law of cosines.

A script be found in the repro mission "9173_Inconsistent_FOV_2.Stratis.zip" here: http://feedback.arma3.com/view.php?id=9173

Note the zoom value displayed in that mission is relative to the soldiers view. To match the zoom level displayed in game by some equipment and vehicles, this should be multiplied by 14/15 (ie, default soldier zoom is 0.93333333x)

I have also modified q1184's CBA getFov function (available here) which should hopefully make it into future versions of CBA. It returns vertical FOV in radians and a relative zoom value to remain consistent with older versions of the script, although it should be obvious how to modify it to return any preferred measure of FOV, including a straight config zoom. The clever method q1184 used is to compare the tangent ratio of known right angle triangle geometry against the screen position of a point offset into the screen twice as far as it is offset from the middle of the screen. It is fast, efficient, accurate and works in all situations, even if the point is off the screen.

Changing field of view

That's all nice, now how can you modify field of view? The best way would be using an config mod that changes only the soldier units view configs. To calculate the in game FOV for any config FOV/zoom value depends on the aspect ratio:

horzFOV = 2 * atan (0.75 * configFOV * aspectRatio)

vertFOV = horzFOV / aspectRatio

The results of these are in radians. aspectRatio is display width/display height.

Modifying fovTop and fovLeft changes all views in the game (including weapon scopes etc). It also breaks the reported zoom level reported by various weapons (they all assume default fov). If you really want to modify Arma3profile config file, this is how to do so:

1. Calculate your aspect ratio, width divided by height, eg 16:10 => 1.6

If you want to use a specific zoom/magnification for the default soldier view (note the default soldier view zoom = 14/15 == 0.933333333 to match in game vehicles/equipment UI):

2. fovTop = 0.7 / (desired zoom)

3. fovLeft = fovTop * (aspect ratio)

If you want to use a specific horizontal field of view (hFOV) in degrees

2. fovTop = 4/3 * tan(hFOV/2) / (aspect ratio)

3. fovLeft = fovTop * (aspect ratio)

Examples:

Screen is 1920 x 1080, I want to have a default soldier horizontal field of view of 120°

1. aspect ratio = 1920/1080 == 16/9

2. fovTop = (4/3) * tan(120/2) / (16/9) == 1.299038106

3. fovLeft = 1.299038106 * (16/9) == 2.309401078

Screen is 1920 x 1200, I want to have a default soldier zoom of 0.75x

1. aspect ratio = 1920/1200 == 16/10

2. fovTop = 0.7 / 0.75 == 0.93333333

3. fovLeft = 0.93333333 * 16/10 == 1.493333333

Configs

Vehicles and weapons have three config values per view that define the zoom levels: initFov, minFov and MaxFov. These values get scaled using the current fovTop and fovLeft.

The in game zoom level for any config Fov value for any view in a vehicle/weapon class is calculated as follows:

zoom = 0.525 / ((fovTop) * (configFov)

And the in game horizontal field of view (hFov) for that zoom:

hFov = 2 * arcTan ((0.525 * aspect ratio) / zoom)

Example:

Screen is 1920 x 1080, edited config fovTop = 0.9, fovLeft = 1.6. What will the horizontal field of view be for soldier max zoom view (minFov == 0.375)?

1. aspect ratio = 1920/1080 == 16/9

2. zoom = 0.525 / (0.9 * 0.375) == 14/9

3. hFov = 2 * arcTan ((0.525 * (16/9) / 14/9) == 61.93°

Edited by ceeeb
21:9 != 21:9
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks, and for good measure people are also discussing FOV here-

http://forums.bistudio.com/showthread.php?158811-Customize-field-of-view!

PS- At the moment I'm trying to find out how to make the 'temporary zoom' less severe in external/3rd person view.

I hold the right mouse button and it zooms in far too much, especially with planes and helos, so i'll try tinkering with

initFov, minFov and MaxFov or something.

Edited by PoorOldSpike

Share this post


Link to post
Share on other sites

jesus...i'm so stupid that forget convert TAN's degree to radian. that why calculate is so confuse.

On 2/16/2014 at 12:22 PM, ceeeb said:

2. fovTop = (4/3) * tan(120/2) / (16/9)  == 1.299038106

 

120 deg's radian is 2.094395, so equation should be :

fovtop = (4/3) * TAN(2.094395102/2) / (16/9) = 1.299038105

 

thus,90 deg horizontal convert to radian is 1.570796327, and calculate like this:

fovtop = (4/3) * TAN(1.570796327/2) / (16/9) = 0.75

vallina fov in 16:9 screean is 90 deg, not 70. in game test is also confirm.

 

anyway,thanks you so much😂

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×