+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15

Thread: fov and sens

  1. #11
    Senior Member Lorfa is a jewel in the rough Lorfa is a jewel in the rough Lorfa is a jewel in the rough Lorfa's Avatar
    Join Date
    Aug 2010
    Location
    Kepler-22b
    Posts
    8,896
    Quote Originally Posted by inertiacreeP View Post
    so +zoom will change the FOV, and then the OP will be using 3.0804 sensitivity while zoomed in instead of 4, correct?
    Assuming zoomfov 80, and fov 100, sens 4, zoomsens 1, yes it will become 3.0804.

    If that's correct, I was wondering how ID Software decided on that particular formula to maintain the "feel".
    They didn't actually. The algorithm used in q3 was different and somewhat inferior. You can still use this algorithm by setting cg_zoomSensitivity to 0. It is:

    k = arctan(tan(zoomfov * (pi/360)) * height/width ) * (360/pi) / 75
    Note: Do not convert zoomfov into degrees in this case.

    As far as I know, it was Injx who suggested the current, correct type version.

    Think it might involve some programming knowledge to understand though.
    This is my theory:

    To maintain the same "feel", the idea is to make the pixels in the center move at the same speed across the two fovs.

    If you were zooming in to an image the way you do in a photo editor, then maintaining the same feel would be as simple as sens * k where k = zoomfov/fov. If you see half the screen, use half the sens.

    However quake and various other 3d programs don't work this way. There is a distortion to fit the 3d view into the 2d screen. This distortion takes the form of a pincushion distortion.

    To look around the 3d world, you have a view frustum (4 sided pyramid), the "point" of the pyramid being the player's eye. As fov increases, the angle at the "point" increases.

    You can kind of see this effect at the bottom of the page here:

    http://www.mathsisfun.com/algebra/trigonometry.html

    One side of a frustum is an isosceles triangle, half that is a right triangle, so imagine that there is another triangle placed under the one in the diagram, such that a 45 degree right triangle is actually part of a 90 degree isosceles triangle.

    You see the distance to the curve's center (the curve on the unit circle) increasing relative to the "base" of the isosceles triangle, and I believe that this is the image undergoing a pincushion distortion as fov increases.

    However even so, sens * zoomfov/fov still takes care of this since the center remains stable. The trouble comes from the aspect ratio not being 1:1, which means that there is more distortion for one axis than another, and this makes for slower moving pixels on one axis, since they move slower relative to the pixels on the side which move faster to compensate and maintain the same amount of time to be taken for a given amount of change in degrees (sens).

    So when I zoom in on say 4:3, I'm going from slower moving center pixels --> faster moving center pixels when I zoom in, and since higher sensitivity moves the center pixels faster (all pixels really), it stands to reason that the zoomed in sensitivity should be lower than what it would be if there was no pincushion.

    This coincides with the current zoom calculation. For example, using fov 100, zoomfov 50:

    http://www.wolframalpha.com/input/?i...ees%2F2%5D+%5D

    This makes k = 0.461257 , whereas with no pincushion we could just do 50/100 = 0.5

    sens * 0.46 < sens * 0.5

    I'm pretty sure that 0.75 is the aspect ratio (3/4). Since it also has to calculate for aspect ratios different than 4:3, I think what it does in the code is multiply the result by a correction factor, such that everyone can use the same formula without having to also consider their aspect ratio.

    Note that if we had a 1:1 aspect ratio, 0.75 would be replaced with a 1, and since arctan(tan(x)) = x , we would have our zoomfov/fov algorithm again, where half the fov would mean half the sens. So, this 0.75 is the correction for the horizontal being wider than the vertical.

    The "x/2" part of tan(x/2) is referring to the isosceles triangle of the frustum being cut in half so that right triangle math applies to it.

    I wanted to play other FPS games that had sniper scopes, and was hoping if they didn't have a similar way of handling zoom FOV/sens that I could try to emulate it by having my zoom FOV as 22.5 (QL default) and a similar zoomed in sensitivity as QL. But not all games will let me tweak those parameters so I might just have to get used to their engine.
    One of the great things about QL is its tweakability!
    Last edited by Lorfa; 01-19-2013 at 08:54 PM.

  2. #12
    Senior Member EvilSuperman is on a distinguished road EvilSuperman's Avatar
    Join Date
    Aug 2010
    Location
    Australia QLD
    Posts
    278
    this is the difference between T3 and T4.....all this pro stuff you guys do is all in the set up...well mostly..I do gather that experience in the game helps a bit as well.

  3. #13
    Senior Member Lorfa is a jewel in the rough Lorfa is a jewel in the rough Lorfa is a jewel in the rough Lorfa's Avatar
    Join Date
    Aug 2010
    Location
    Kepler-22b
    Posts
    8,896
    Quote Originally Posted by EvilSuperman View Post
    this is the difference between T3 and T4.....all this pro stuff you guys do is all in the set up...well mostly..I do gather that experience in the game helps a bit as well.
    This conversation of ours has nothing to do with playing well.

    We're just trying to understand what makes the sens feel right when you zoom in. It happens to be a bit wordy.

  4. #14
    Member inertiacreeP is on a distinguished road
    Join Date
    Dec 2010
    Posts
    86
    wowzer, thanks for that post! that's pretty much what i was looking for, some sort of rationale behind things. very interesting. i knew someone on the quake forums would be knowledgeable enough to shed some light.

    so for a 16:9 ratio, instead of .75 we would have .5625. i'll have to run the calculation with my other game's FOVs and see if i can get something to work out, if not i'll have to tweak away at it.

    very cool. thanks lorfa.

    Quote Originally Posted by EvilSuperman View Post
    this is the difference between T3 and T4.....all this pro stuff you guys do is all in the set up...well mostly..I do gather that experience in the game helps a bit as well.
    nah, a few things can be important to set up but learning from mistakes and your mindset are most important for success IMO. chance from team EG wrote the Quake Bible which i think covers most of the bases, meanwhile tweaking i think is covered in a few guides in the getting started forum here.

  5. #15
    Senior Member Lorfa is a jewel in the rough Lorfa is a jewel in the rough Lorfa is a jewel in the rough Lorfa's Avatar
    Join Date
    Aug 2010
    Location
    Kepler-22b
    Posts
    8,896
    Quote Originally Posted by inertiacreeP View Post
    so for a 16:9 ratio, instead of .75 we would have .5625. i'll have to run the calculation with my other game's FOVs and see if i can get something to work out, if not i'll have to tweak away at it.
    Yeah like I said I think it is multiplied by a correction factor for non 4:3 so everyone can use the same algorithm with the 0.75 in it, and only change zoomfov and fov.

    So something like:

    If h:w = 4:3, x = 1
    If h:w != 4:3, x = somemath on (h:w) /* Correction factor

    k = arctan[ 0.75 * tan[cg_zoomfov/2] ] / arctan[ 0.75 * tan[cg_fov/2] ]

    zoomsens = (sens * k * x)

    This is speculation though, without the source code there is no way to be sure. Maybe you could run a debugger on QL while it is running and catch some of these functions in action, but that's definitely over my head.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts