Well I'm not sure exactly what the problem is. To say the least getting into
some of this code isn't very easy.

Here's a patch that forces a single update after the FDM initializes. 
Actually I think what this does is just delay the lighting update until the
second frame, since as far as I can tell the FDM isn't updated on the first
pass through MainLoop.  It does appear that the FDM update is critical to
getting a good result from fgUpdateSkyAndLightingParams().

If anyone is interested below the patch is a log for two successive calls to
the lighting update one each of during processing of frames 1 and 2.  Note
that there is a huge jump in the Sun position between the first and second frame.

Best,

Jim


Index: main.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Main/main.cxx,v
retrieving revision 1.129
diff -u -r1.129 main.cxx
--- main.cxx    17 Sep 2003 10:02:36 -0000      1.129
+++ main.cxx    18 Sep 2003 01:23:50 -0000
@@ -928,6 +928,11 @@

         if ( !inited ) {
             inited = true;
+
+            // following run once after fdm is inited...
+            fgUpdateSkyAndLightingParams();
+            // above run once after fdm inits
+
         }

         if ( ! replay_master->getBoolValue() ) {
@@ -1392,7 +1397,6 @@
         fgReshape( fgGetInt("/sim/startup/xsize"),
                fgGetInt("/sim/startup/ysize") );

-        fgUpdateSkyAndLightingParams();
     }

     if ( idle_state == 1000 ) {








Loading tile /usr/src/games/fgfs/Scenery-0.9.2/w010n00/w001n00/2938503
  Updating Sun position
  Gst = 17.5722
    t->cur_time = 1025564412
    Sun Geodetic lat = 0.0366661 Geocentric lat = 0.0364209
sun angle relative to current location = 0.824245
  Updating Moon position
    t->cur_time = 1025564412
    Moon Geodetic lat = 0.433565 Geocentric lat = 0.43101
moon angle relative to current location = 0.996144
Updating light parameters.
  Sun angle = 47.2258
  ambient = 0.2  diffuse = 0.999277  specular = 0.5  sky = 0.997832
$GPRMC,230013,A,0000.000,N,00000.000,E,000.0,000.0,0107102,0.000,E*40
$GPGGA,230013,0000.000,N,00000.000,E,1,,,00,F,,,,*19
$PATLA,115.80,280.0,115.80,280.0,379*59
Error writing to socket: 5500
Error writing data.
load() base search path = /usr/src/games/fgfs/Scenery-0.9.2
Loading tile /usr/src/games/fgfs/Scenery-0.9.2/w010n00/w001n00/2938511
  Updating Sun position
  Gst = 17.5724
    t->cur_time = 1025564413
    Sun Geodetic lat = 0.402627 Geocentric lat = 0.400212
sun angle relative to current location = 0.654801
  Updating Moon position
    t->cur_time = 1025564413
    Moon Geodetic lat = -0.0710015 Geocentric lat = -0.0705277
moon angle relative to current location = 2.24961
Updating light parameters.
  Sun angle = 37.5174
  ambient = 0.2  diffuse = 1  specular = 0.5  sky = 1



_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to