Quantcast What is the FOV of WoW? - WoWInterface
Thread Tools Display Modes
06-15-10, 05:10 AM   #1
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
What is the FOV of WoW?

Hi all!

I'm making a compass addon with a POI feature that makes little dots which mark the directions to the corresponding POI's. When that dot is in the center of your screen your facing the POI directly, and when you turn a bit to the right the dot moves to the left(which is logical, if you are facing a house in WoW and turn to the right the house moves to the left) of the screen. What I want is when the POI goes off-screen thanks to the FOV I want the dot also go off-screen. Now to do this I need to know the FOV of WoW, hence my question.

Some extra info:
I know the distance to the POI in yards.
I know the angle "that would be needed to turn to the right to correctly face the POI", example: a house is in front of you and you turn 90 degrees to the right the angle is -90.
The angle goes from -180 to 180 where 0 is perfectly facing the POI.
I place the dots on the screen like this, which assumes a FOV of 180 degrees:
Code:
dot:SetPoint("TOP", UIParent, dot.angle/90 * -GetScreenWidth(), 0)
I hope you guys can help me!
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
06-15-10, 05:36 AM   #2
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
I guess you mean the fov when the player is 100% zoomed in. (because zoomed out the fov would fluctuate.

However, the common norm in default fov for first person is between 60-75 (Sometimes 90 aswell) So try those numbers and see what you can come up with.

Otherwise to account for the player zooming out I guess you would have to find out how far the player zoomed out and do some math with that :P
__________________

  Reply With Quote
06-15-10, 07:45 AM   #3
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 199
Afaik, the FOV stays the same, no matter what the camera distance from the player is.
It depends mostly (if not completely) on the aspect ratio of the WorldFrame. So, players with a widescreen have a higher FOV than players with 4:3.
I needed to calculate it for my 3D coordinate addon Coordinator Around lines 94/95 is the part of it, although it does not calculate the FOV directly, but it relates to it.

Just try to experiment a bit with the aspect ratio.

Btw, I planned to rewrite Coordinator very similar to your idea, since Blizz' disabled the camera-cVars. I need my 3D-quest target for leveling :/
__________________
« Website | GitHub »

Oh hai!

Last edited by xConStruct : 06-15-10 at 07:50 AM.
  Reply With Quote
06-15-10, 01:38 PM   #4
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
As far as I know you can still get the camera DISTANCE in 3.3.5, and otherwise you can hack it in such a way that you manually set it, make sure the camera distance is always on the maximum and replace the scroll functions with functions that change the max camera distance instead.

What I basicly want is when you face directly at a house, the point will float in the middle of the screen(note that I'm completely ignoring the Z axis in this whole project, I'm not interested in it), and when you "keyboard-turn" to the right the point will move to the left of the screen at the exact same speed as the house does in the WorldFrame. This is just a matter of getting the right FOV coëfficient right? And camera distance DOES matter(although not a lot), just do this little experiment:

Move your face really close to the screen and turn your head to the right until you can't see the screen anymore. Now roughly estimate the angle you turned and remember it. Now move a few meters from the screen and do the same, you will note a difference.

SOMETHING I NOTED WHILE WRITING THIS POST:
Forget what I said about camera distance mattering, it only matters if the object were talking about has a certain width, which a POINT does not have.
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
06-15-10, 02:25 PM   #5
lilsparky
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 117
when you say the camera distance doesn't matter, are you talking about the distance of the object to the camera or the distance of the camera from the player? the way the camera works in wow is like a large boom attached to the player. rotating the camera rotates the boom around the player. a greater distance from the player to the camera means the camera "swings" over a larger arc which will most definitely have an impact on your math.
  Reply With Quote
06-15-10, 02:30 PM   #6
Psychophan7
A Chromatic Dragonspawn
Join Date: Feb 2006
Posts: 153
The horizontal FOV changes depending on how wide your screen is compared to it's height. The vertical FOV is constant, at what I think is 90°. To prove this, get a viewport addon, and make shrink either the height or the width (not both!) and observe the changes; You should only be able to see further left/right.
  Reply With Quote
06-15-10, 02:36 PM   #7
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Originally Posted by lilsparky View Post
when you say the camera distance doesn't matter, are you talking about the distance of the object to the camera or the distance of the camera from the player? the way the camera works in wow is like a large boom attached to the player. rotating the camera rotates the boom around the player. a greater distance from the player to the camera means the camera "swings" over a larger arc which will most definitely have an impact on your math.
I think you should get the camera offset from the player in X and Y values, and start calculating distances/angles from there, which will then get broken in 3.3.5. So screw camera distance, since you can't do triangulation math on it in 3.3.5 anymore.

I'll experiment tomorrow with resolution and FOV.
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
06-16-10, 02:07 PM   #8
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
is the 3.3.5 changes all to doing camera stuff on the main world frame? or in general? like can you still do 3d animated player models? those require a lot of camera functions.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
06-16-10, 03:21 PM   #9
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,674
No, 3d models don't require the camera functions.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
06-16-10, 03:41 PM   #10
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
your right im thinking something else... lol.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
06-16-10, 04:55 PM   #11
Aarokh
A Cyclonian
 
Aarokh's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 40
To me this sounds like some workaround for an AVR-like Addon..
  Reply With Quote
06-17-10, 01:13 AM   #12
Olog
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 8
This indeed sounds very much like what AVR did but possibly ignoring one dimension. I haven't been to the test server so I don't know for certainty which of the camera cvars are disabled but my understanding is that all of them, that is you can't even get the distance.

Camera distance also does matter on where the point of interest will show up on your screen. For example supposing that the point of interest is one yard in front of your character and camera is 20 yards away. Now regardless of which way you're facing the point will appear almost at the center of the screen. And camera pitch also affects the X-coordinate of the point.

If the distance to the point is much bigger than camera distance then the error will be small and you can ignore camera position relative to player. So if the point of the addon is to aid in navigating to quest areas etc then you can probably do that just fine without taking into account camera distance. The error will only become significant when you're already very close to the point.

As for field of view angle, WoW has a constant vertical field of view (except when you're drunk). In AVR my projection plane is 0.98 yards away and it's 1 yard tall. That gives about 54.1 degrees vertical angle. The horizontal angle then depends on the aspect ratio of the world frame. A 16/9 aspect ratio gives about 84.4 degrees horizontal fov or 91.7 degrees corner to corner fov.
  Reply With Quote
06-17-10, 01:21 AM   #13
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
It indeed is a lot like what AVR did, but for different purposes. I'm indeed ignoring the Z axis, and I'm also ignoring camera position, thus making it not an overlay for the world, more like a compass.

I'm kinda stuck here, because I know that I have enough data to render, but I don't know how.

I know the distance to the point.
I know the position of me and the point.
I know the angle between your facing and the point, ranging from -180 to 180 where 0 is a perfect facing.

Now the dots on the screen are glued in a fixed Y position(in my case all on the top of the screen), only the X position varies. Please help me, because I really dont know how to determine the correct X position of the dot. I can easily rework the angle into an other scale(radians, from 0 to 360 with 0 being perfect facing, etc), no matter how you want it but someone please help me I'm stuck

EDIT: Once I'm done with this I MIGHT take camera distance into account.
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
06-17-10, 02:03 AM   #14
Olog
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 8
If you know the angle then tangent gives you the horizontal coordinate one unit away from camera. From the values I used in AVR one unit corresponds to WorldFrame:GetHeight()/2*0.98 pixels.

If dot.angle is in radians then something like this

Code:
c=WorldFrame:GetHeight()/2*0.98
dot:SetPoint("TOP", UIParent, math.tan(dot.angle)*c, 0)
Just take care of the special cases like when the dot is behind the camera.
  Reply With Quote
06-17-10, 03:14 AM   #15
lilsparky
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 117
it should be trivial to figure out how to turn your angle offset into an x coord -- if your theory is sound.

myDot:SetPoint("CENTER",UIParent,"CENTER",angle*factor,0)


angle = the angle between your facing and the direction to the POI (0 = aiming at it, <0 = you're looking to the right, >0 = you're looking to the left)

factor= some fixed value

it's just a matter of trial and error. turn your toon so that your POI is on the edge of the screen and then set your factor to put the point there. it would probably help to have some means of adjusting your factor while running the game (slash command or even just /script myMod.factor = xxxx)


once you plug in a factor that works, see how well it locks to the world. i'm guessing you'll be disappointed when change your camera distance.
  Reply With Quote
06-17-10, 04:13 AM   #16
Olog
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 8
Constant factor as lilsparky suggests isn't technically right but since we're dealing with quite small angles it's a pretty good approximation. Since you're bound to have other inaccuracies too doing it accurately by taking the tangent might be pointless.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » What is the FOV of WoW?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off