Hi,
Maik Justus schrieb am 26.12.2007 20:38:
Hi Syd,

what's about an algorithm, which checks the ratio of the screen and sets fow to 55 for 4:3 screens and 70 for 16:9 screens? (55 / 70 = (4/3) / (16/9) )

Maik
P.S.:
for non-physicists:
(55 / 73,33333333333333333333333333333333333 =  (4/3) / (16/9) )

Meanwhile I have a new computer wit 16:9 screen and the same problem. I've modified the calculation in viewer.cxx as mentioned above. Syd, please check, if this would work for you. Then we can think about, how to implement that in a clean way (maybe we need an FG_SCALING_HEIGHT case?). The patch is for the osg-branch, but it works with the plib branch, too (maybe some lines offset).

Maik
Index: viewer.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Main/viewer.cxx,v
retrieving revision 1.27
diff -u -p -r1.27 viewer.cxx
--- viewer.cxx  5 Nov 2007 22:19:39 -0000       1.27
+++ viewer.cxx  4 Jan 2008 19:54:11 -0000
@@ -640,15 +640,15 @@ FGViewer::get_h_fov()
 {
     switch (_scaling_type) {
     case FG_SCALING_WIDTH:  // h_fov == fov
-       return _fov_deg;
+       return _fov_deg/_aspect_ratio/4*3;
     case FG_SCALING_MAX:
        if (_aspect_ratio < 1.0) {
            // h_fov == fov
-           return _fov_deg;
+           return _fov_deg/_aspect_ratio/4*3;
        } else {
            // v_fov == fov
            return
-                atan(tan(_fov_deg/2 * SG_DEGREES_TO_RADIANS)
+                atan(tan(_fov_deg/_aspect_ratio/4*3/2 * SG_DEGREES_TO_RADIANS)
                      / (_aspect_ratio*_aspect_ratio_multiplier))
                 * SG_RADIANS_TO_DEGREES * 2;
        }
@@ -666,19 +666,19 @@ FGViewer::get_v_fov()
     switch (_scaling_type) {
     case FG_SCALING_WIDTH:  // h_fov == fov
        return 
-            atan(tan(_fov_deg/2 * SG_DEGREES_TO_RADIANS)
+            atan(tan(_fov_deg/_aspect_ratio/4*3/2 * SG_DEGREES_TO_RADIANS)
                  * (_aspect_ratio*_aspect_ratio_multiplier))
             * SG_RADIANS_TO_DEGREES * 2;
     case FG_SCALING_MAX:
        if (_aspect_ratio < 1.0) {
            // h_fov == fov
            return
-                atan(tan(_fov_deg/2 * SG_DEGREES_TO_RADIANS)
+                atan(tan(_fov_deg/_aspect_ratio/4*3/2 * SG_DEGREES_TO_RADIANS)
                      * (_aspect_ratio*_aspect_ratio_multiplier))
                 * SG_RADIANS_TO_DEGREES * 2;
        } else {
            // v_fov == fov
-           return _fov_deg;
+           return _fov_deg/_aspect_ratio/4*3;
        }
     default:
        assert(false);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to