Need horizontal and vertical FOV angles
by David Hahnert · in Torque Developer Network · 04/05/2009 (7:58 pm) · 6 replies
What is the angle of the field of sight for a default perspective in TGEA?
I need angles for horizontally across across the screen and for vertically.
In other words...
If you standing in a circle on the ground in torque how much of that circle would you see?
If you were standing in a hamster wheel what % of that hamster wheel would you see?
Both for default perspective views in TGEA please. I don't plan on changing them and need them for calculations.
I need angles for horizontally across across the screen and for vertically.
In other words...
If you standing in a circle on the ground in torque how much of that circle would you see?
If you were standing in a hamster wheel what % of that hamster wheel would you see?
Both for default perspective views in TGEA please. I don't plan on changing them and need them for calculations.
#2
04/07/2009 (5:43 pm)
Thanks a lot man, I've been looking all over for this.
#3
if your viewport were a circle, then a viewing cone would correctly describe it and you would indeed have just one FOV.
however the viewport is a rectangle, and so you will have a different FOV across than up-and-down. i _think_ the "FOV" value is the FOV from one corner of the viewport to the other. what the vertical and horizontal FOVs are that result from this will depend on the aspect ratio of the viewport.
assuming that FOV_D is the field of view across a diagonal of the viewport, i would take a guess that FOV_X, the horizontal field of view, equals (ScreenWidth * FOV_D) / sqrt(ScreenHeight^2 + ScreenWidth^2), and that FOV_Y equals (ScreenHeight * FOV_D) / sqrt(ScreenHeight^2 + ScreenWidth^2).
let's see, when ScreenWidth = ScreenHeight, that would give you a horizontal and vertical FOV of FOV_D / sqrt(2), which seems reasonable,
and as ScreenWidth becomes much larger than ScreenHeight, FOV_X approaches FOV_D, which also seems reasonable. so, yeah, i'd go for that.
04/07/2009 (6:28 pm)
i think the answer is slightly more complex.if your viewport were a circle, then a viewing cone would correctly describe it and you would indeed have just one FOV.
however the viewport is a rectangle, and so you will have a different FOV across than up-and-down. i _think_ the "FOV" value is the FOV from one corner of the viewport to the other. what the vertical and horizontal FOVs are that result from this will depend on the aspect ratio of the viewport.
assuming that FOV_D is the field of view across a diagonal of the viewport, i would take a guess that FOV_X, the horizontal field of view, equals (ScreenWidth * FOV_D) / sqrt(ScreenHeight^2 + ScreenWidth^2), and that FOV_Y equals (ScreenHeight * FOV_D) / sqrt(ScreenHeight^2 + ScreenWidth^2).
let's see, when ScreenWidth = ScreenHeight, that would give you a horizontal and vertical FOV of FOV_D / sqrt(2), which seems reasonable,
and as ScreenWidth becomes much larger than ScreenHeight, FOV_X approaches FOV_D, which also seems reasonable. so, yeah, i'd go for that.
#4
04/07/2009 (6:30 pm)
.. hmm, there may be an arccos missing in there..
#5
The ArcCos( should be called on the FOV_D in the FOV_X calculation and
ArcSin( should be called on the FOV_D in the FOV_Y calculation.
The resolution can be retrieved from GFX->getViewport() (in engine) or something like that for anybody else following along.
Thank you Orion.
04/07/2009 (8:03 pm)
Oh that makes much more sense, I kept wondering why Torque was giving me 2 values whenever I'd ask it for the FOV. I was expecting two (an x and y component). I agree with your solution.The ArcCos( should be called on the FOV_D in the FOV_X calculation and
ArcSin( should be called on the FOV_D in the FOV_Y calculation.
The resolution can be retrieved from GFX->getViewport() (in engine) or something like that for anybody else following along.
Thank you Orion.
#6
04/08/2009 (12:43 pm)
np. i love your hamster wheel analogy - very apt!
Associate Michael Hall
Distracted...
And other, possibly useless, information:
Zoom FOV is defaulted to 45, but can be incremented/decremented at any interval.
FOV can be set as low, or high as you want it (theoretically), though I've noticed a "fishbowl" effect on non-widescreen monitors at more than 120 degrees.