Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / FOV and aspect ratio

Author
Message
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 13th Aug 2013 23:14
Is there a ratio / relationship between camera FOV and aspect ratio?

For instance, I have a FOV of 45 degrees which looks right on 16:9, but need to set FOV 55 for aspect ratio of 4:3

I got this by trial and error, but is there a formula for this? What about other aspect ratios?

The Zoq2
15
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 13th Aug 2013 23:30
Hmm, this is how it should work if im not misstaken.

FOV sets the area of the 3d world to be projected on the screen by the angle of a cone at the center of the camera. An FOV of 45 sets the angle of the cone to 45 degrees on one axis. In order to not stretch the view, the FOV on the axis that is not manually set is calculated based on the display aspect.

Most games use a horizontal FOV system, setting the FOV to 45 will set the angle of the cone to 45 degrees on the xAxis. The y axis will then be calculated based on the display aspect. (FOV * (height / width)) which makes the vertical FOV in this case 45 * (9 / 16)

The FOV on the x axis will always stay at 45 degrees but the FOV on the y axis will depend on the display aspect. If you want to use a vertical FOV instead, you need to calculate the FOV based on the display aspect

Say ONE stupid thing and it ends up as a forum signature forever. - Neuro Fuzzy
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 13th Aug 2013 23:45
Changing FOV to 55 worked on the Y axis for me and allowed me to letterbox a modified 16:9 screen to 4:3
(I had already changed aspect ratio from 1.777778 (16:9) to 1.333333 (4:3).
The situation was that I changed FOV from 45 (the 16:9 setting) to 55 (the 4:3 setting), which preserved the x-res, but gave me an expected and acceptable letterbox.

My question was what is the ratio of FOV value vs aspect ratio if there is such a thing, or would I have to manually set FOV for every possible aspect ratio?

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Aug 2013 13:35 Edited at: 14th Aug 2013 13:36
I thought FOV was calculated as The Zoq2 suggested but from what you are saying it works differently (using vertical view angle). Some quick calculations required...

Something like this should work:
newFOV# = oldFOV# + (1.0-(newASP# / oldASP#)) * oldFOV#

Edit: Where oldASP# = 16.0/9.0 and newASP# = 4.0/3.0 (for example)

"Here I am trying to do some good for the world..." - Fluffy Rabbit

Login to post a reply

Server time is: 2024-11-24 17:39:43
Your offset time is: 2024-11-24 17:39:43