by mh » Sun Aug 25, 2013 11:33 am
I'm actually quite satisfied that the calculations I've got are correct. If for example you plug some values into the widescreen FOV calculator I linked, going from 800x600 with fov 90 to something weird like 800x480, it gives an equivalent FOV of 102.68038349182, which my code calculates 102.68038 for, and maintains the same vertical FOV (68.038696) in both cases.
This isn't a theory - I've cross-checked it with multiple different sources, going from widescreen to non-widescreen, and with variable sbar heights, and it's consistent in all cases. Using 640x432 as a baseline maintains the same vertical FOV for all different values of sbar height too, which is also important to get right.
My code is also consistent for "tallscreen" modes like 300x676, making horizontal FOV constant but allowing vertical FOV to stretch the height, and again it maintains the same FOV for all values of sbar height. I haven't yet checked how the QuakeSpasm code behaves in that scenario, but even though nobody will ever actually use such a mode, it is important for verifying correctness.