So I implemented a game mechanic where drawing a bow will display a shrinking rectangle that should represent the shooting accuracy. The rectangle is smallest after about 1.5 seconds of drawing the bow.
Now the question is, how do i correctly map the size of the rectangle to the projectiles flying direction?
My first though is to give the projectile a random angle deviation and the aiming rectangle is the max angle deviation, but I guess I somehow have to take the FoV angle into consideration somehow? Furthermore, is the FoV Angle uniformly distributed across a 2D screen or is the change of angle greater at the edges of the screen?
With a uniform distribution I guess it comes down to a very simple calulation.
- FoV = 70°
- Max Yaw and Pitch deviation at 1.5 seconds = 10°
- Screen resolution: 1920x1680
Size of aiming rectangle:
- width: 10/70 * 1920 ~= 274 pixels
- height: 1680/1920 * 274 ~= 239pixels
Is that correct?
For clarity here is a screenshot of that aiming rectangle that shrinks over time: https://www.vintagestory.at/uploads/monthly_2017_07/2017-07-22_22-48-10.png.86e757f209fde73b769726e7c12aaeb1.png