]> git.mxchange.org Git - flightgear.git/commitdiff
Continuing to try to align stars correctly.
authorcurt <curt>
Mon, 22 Sep 1997 14:44:19 +0000 (14:44 +0000)
committercurt <curt>
Mon, 22 Sep 1997 14:44:19 +0000 (14:44 +0000)
Cockpit/depend
Main/GLUTmain.c
Main/fg_init.c
Scenery/Makefile
Scenery/stars.c
Time/Makefile
Time/depend

index a271456de9289405b642c5e1ece4c5cad90bf0dd..04135f2bae96bc6e1ee5e04eb348d76cffe6c328 100644 (file)
@@ -18,13 +18,3 @@ hud.o: hud.c hud.h ../Aircraft/aircraft.h \
  ../Scenery/scenery.h ../Scenery/../types.h ../Math/mat3.h \
  ../Math/polar.h ../Math/../types.h ../Time/fg_timer.h \
  ../Math/fg_random.h ../Weather/weather.h
-test.o: test.c test.h ../Aircraft/aircraft.h \
- ../Aircraft/../Flight/flight.h ../Aircraft/../Flight/Slew/slew.h \
- ../Aircraft/../Flight/LaRCsim/ls_interface.h \
- ../Aircraft/../Flight/LaRCsim/../flight.h \
- ../Aircraft/../Controls/controls.h \
- ../Aircraft/../Controls/../limits.h ../Flight/flight.h \
- ../Controls/controls.h ../constants.h ../Scenery/mesh.h \
- ../Scenery/scenery.h ../Scenery/../types.h ../Math/mat3.h \
- ../Math/polar.h ../Math/../types.h ../Time/fg_timer.h \
- ../Math/fg_random.h ../Weather/weather.h
index d8dc658e9478fc1413cf8a83cac279d34c38a0a3..c5a21745b24da5337052b9085e11d8f7a7015261 100644 (file)
@@ -192,6 +192,8 @@ static void fgUpdateViewParams() {
 
     sky = 0.85 * pow(1.2, -x_8 / 20.0) + 0.15;
 
+    sky = 0.15; /* force a dark sky (for testing) */
+
     if ( ambient < 0.1 ) { ambient = 0.1; }
     if ( diffuse < 0.0 ) { diffuse = 0.0; }
 
@@ -575,9 +577,12 @@ int main( int argc, char *argv[] ) {
 
 
 /* $Log$
-/* Revision 1.19  1997/09/18 16:20:08  curt
-/* At dusk/dawn add/remove stars in stages.
+/* Revision 1.20  1997/09/22 14:44:19  curt
+/* Continuing to try to align stars correctly.
 /*
+ * Revision 1.19  1997/09/18 16:20:08  curt
+ * At dusk/dawn add/remove stars in stages.
+ *
  * Revision 1.18  1997/09/16 22:14:51  curt
  * Tweaked time of day lighting equations.  Don't draw stars during the day.
  *
index 2604bd29d6375587ed6b4303a83f4ad2224f1068..4c97095ac804742586cd2283f801016948d871d0 100644 (file)
@@ -76,7 +76,7 @@ void fgInitSubsystems( void ) {
     double cur_elev;
 
     struct FLIGHT *f;
-    struct TIME *t;
+    struct fgTIME *t;
     struct VIEW *v;
 
     f = &current_aircraft.flight;
@@ -90,29 +90,32 @@ void fgInitSubsystems( void ) {
      ****************************************************************/
 
     /* Globe Aiport, AZ */
-    FG_Runway_altitude = 3234.5;
-    FG_Runway_latitude = 120070.41;
     FG_Runway_longitude = -398391.28;
+    FG_Runway_latitude = 120070.41;
+    FG_Runway_altitude = 3234.5;
     FG_Runway_heading = 102.0 * DEG_TO_RAD;
 
     /* Initial Position at GLOBE airport */
-    FG_Latitude  = (  120070.41 / 3600.0 ) * DEG_TO_RAD;
     FG_Longitude = ( -398391.28 / 3600.0 ) * DEG_TO_RAD;
+    FG_Latitude  = (  120070.41 / 3600.0 ) * DEG_TO_RAD;
     FG_Altitude = FG_Runway_altitude + 3.758099;
     /* FG_Altitude = 20000; */
     
     /* Initial Position north of the city of Globe */
-    /* FG_Latitude  = (  120625.64 / 3600.0 ) * DEG_TO_RAD; */
     /* FG_Longitude = ( -398673.28 / 3600.0 ) * DEG_TO_RAD; */
+    /* FG_Latitude  = (  120625.64 / 3600.0 ) * DEG_TO_RAD; */
     /* FG_Altitude = 0.0 + 3.758099; */
 
     /* Initial Position: 10125 Jewell St. NE */
-    /* FG_Latitude  = (  45.15 ) * DEG_TO_RAD; */
     /* FG_Longitude = ( -93.15 ) * DEG_TO_RAD; */
+    /* FG_Latitude  = (  45.15 ) * DEG_TO_RAD; */
     /* FG_Altitude = FG_Runway_altitude + 3.758099; */
 
+    FG_Longitude = ( -583200.00 / 3600.0 ) * DEG_TO_RAD;
+    FG_Latitude  = (  110808.41 / 3600.0 ) * DEG_TO_RAD;
+
     printf("Initial position is: (%.4f, %.4f, %.2f)\n", 
-          FG_Latitude * RAD_TO_DEG, FG_Longitude * RAD_TO_DEG, 
+          FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, 
           FG_Altitude * FEET_TO_METER);
 
       /* Initial Velocity */
@@ -212,9 +215,12 @@ void fgInitSubsystems( void ) {
 
 
 /* $Log$
-/* Revision 1.7  1997/09/16 15:50:30  curt
-/* Working on star alignment and time issues.
+/* Revision 1.8  1997/09/22 14:44:20  curt
+/* Continuing to try to align stars correctly.
 /*
+ * Revision 1.7  1997/09/16 15:50:30  curt
+ * Working on star alignment and time issues.
+ *
  * Revision 1.6  1997/09/05 14:17:30  curt
  * More tweaking with stars.
  *
index f6ebee5ddf0196bb69cb6821bc610898e8d0c567..c9088bd7fc32a35c01a312c87a5c714252d09c1c 100644 (file)
@@ -90,11 +90,17 @@ mesh2GL.o:
 scenery.o:
        $(CC) $(CFLAGS) -c scenery.c -o $@
 
+stars.c:
+       $(CC) $(CFLAGS) -c starts.c -o $@
+
 geometry.o:
        $(CC) $(CFLAGS) -c geometry.c -o $@
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.20  1997/09/22 14:44:21  curt
+# Continuing to try to align stars correctly.
+#
 # Revision 1.19  1997/08/27 03:30:23  curt
 # Changed naming scheme of basic shared structures.
 #
index 6c3ff954fe0eac608af9a6fdda57e723ace29196..fb2f67beb38dd1921884acdcd7e1828eaf938c2d 100644 (file)
@@ -121,13 +121,13 @@ void fgStarsInit() {
                sscanf(front, "%lf,%lf,%lf\n", 
                       &right_ascension, &declination, &magnitude);
 
-               if ( strcmp(name, "Hamal") == 0 ) {
+               if ( strcmp(name, "Betelgeuse") == 0 ) {
                    printf("  *** Marking %s\n", name);
                    ra_save = right_ascension;
                    decl_save = declination;
                }
 
-               if ( strcmp(name, "Algenib") == 0 ) {
+               if ( strcmp(name, "Alnilam") == 0 ) {
                    printf("  *** Marking %s\n", name);
                    ra_save1 = right_ascension;
                    decl_save1 = declination;
@@ -141,12 +141,12 @@ void fgStarsInit() {
                if ( magnitude < 0.0 ) { magnitude = 0.0; }
                magnitude = 
                    magnitude * 0.7 + (((FG_STAR_LEVELS - 1) - i) * 0.1);
-               printf("Found star: %d %s, %.3f %.3f %.3f\n", count,
-                  name, right_ascension, declination, magnitude);
+               /* printf("Found star: %d %s, %.3f %.3f %.3f\n", count,
+                      name, right_ascension, declination, magnitude); */
 
                glColor3f( magnitude, magnitude, magnitude );
-               glVertex3f( 190000.0 * sin(right_ascension) * cos(declination),
-                           -190000.0 * cos(right_ascension) * cos(declination),
+               glVertex3f( 190000.0 * cos(right_ascension) * cos(declination),
+                           190000.0 * sin(right_ascension) * cos(declination),
                            190000.0 * sin(declination) );
 
                count++;
@@ -161,33 +161,33 @@ void fgStarsInit() {
 
        glBegin(GL_LINE_LOOP);
         glColor3f(1.0, 0.0, 0.0);
-       glVertex3f( 190000.0 * sin(ra_save-0.2) * cos(decl_save-0.2),
-                   -190000.0 * cos(ra_save-0.2) * cos(decl_save-0.2),
+       glVertex3f( 190000.0 * cos(ra_save-0.2) * cos(decl_save-0.2),
+                   190000.0 * sin(ra_save-0.2) * cos(decl_save-0.2),
                    190000.0 * sin(decl_save-0.2) );
-       glVertex3f( 190000.0 * sin(ra_save+0.2) * cos(decl_save-0.2),
-                   -190000.0 * cos(ra_save+0.2) * cos(decl_save-0.2),
+       glVertex3f( 190000.0 * cos(ra_save+0.2) * cos(decl_save-0.2),
+                   190000.0 * sin(ra_save+0.2) * cos(decl_save-0.2),
                    190000.0 * sin(decl_save-0.2) );
-       glVertex3f( 190000.0 * sin(ra_save+0.2) * cos(decl_save+0.2),
-                   -190000.0 * cos(ra_save+0.2) * cos(decl_save+0.2),
+       glVertex3f( 190000.0 * cos(ra_save+0.2) * cos(decl_save+0.2),
+                   190000.0 * sin(ra_save+0.2) * cos(decl_save+0.2),
                    190000.0 * sin(decl_save+0.2) );
-       glVertex3f( 190000.0 * sin(ra_save-0.2) * cos(decl_save+0.2),
-                   -190000.0 * cos(ra_save-0.2) * cos(decl_save+0.2),
+       glVertex3f( 190000.0 * cos(ra_save-0.2) * cos(decl_save+0.2),
+                   190000.0 * sin(ra_save-0.2) * cos(decl_save+0.2),
                    190000.0 * sin(decl_save+0.2) );
        glEnd();
 
        glBegin(GL_LINE_LOOP);
         glColor3f(0.0, 1.0, 0.0);
-       glVertex3f( 190000.0 * sin(ra_save1-0.2) * cos(decl_save1-0.2),
-                   -190000.0 * cos(ra_save1-0.2) * cos(decl_save1-0.2),
+       glVertex3f( 190000.0 * cos(ra_save1-0.2) * cos(decl_save1-0.2),
+                   190000.0 * sin(ra_save1-0.2) * cos(decl_save1-0.2),
                    190000.0 * sin(decl_save1-0.2) );
-       glVertex3f( 190000.0 * sin(ra_save1+0.2) * cos(decl_save1-0.2),
-                   -190000.0 * cos(ra_save1+0.2) * cos(decl_save1-0.2),
+       glVertex3f( 190000.0 * cos(ra_save1+0.2) * cos(decl_save1-0.2),
+                   190000.0 * sin(ra_save1+0.2) * cos(decl_save1-0.2),
                    190000.0 * sin(decl_save1-0.2) );
-       glVertex3f( 190000.0 * sin(ra_save1+0.2) * cos(decl_save1+0.2),
-                   -190000.0 * cos(ra_save1+0.2) * cos(decl_save1+0.2),
+       glVertex3f( 190000.0 * cos(ra_save1+0.2) * cos(decl_save1+0.2),
+                   190000.0 * sin(ra_save1+0.2) * cos(decl_save1+0.2),
                    190000.0 * sin(decl_save1+0.2) );
-       glVertex3f( 190000.0 * sin(ra_save1-0.2) * cos(decl_save1+0.2),
-                   -190000.0 * cos(ra_save1-0.2) * cos(decl_save1+0.2),
+       glVertex3f( 190000.0 * cos(ra_save1-0.2) * cos(decl_save1+0.2),
+                   190000.0 * sin(ra_save1-0.2) * cos(decl_save1+0.2),
                    190000.0 * sin(decl_save1+0.2) );
        glEnd();
        
@@ -213,6 +213,8 @@ void fgStarsRender() {
 
     /* FG_PI_2 + 0.1 is about 6 degrees after sundown and before sunrise */
 
+    t->sun_angle = 3.0; /* force stars (for testing) */
+
     if ( t->sun_angle > (FG_PI_2 + 5 * DEG_TO_RAD ) ) {
        /* determine which star structure to draw */
        if ( t->sun_angle > (FG_PI_2 + 7.25 * DEG_TO_RAD ) ) {
@@ -237,8 +239,8 @@ void fgStarsRender() {
        /* warp += 1.0; */
        /* warp = 15.0; */
        warp = 0.0;
-       glRotatef( -(angle+warp), 0.0, 0.0, 1.0 );
-       printf("Rotating stars by %.2f degrees + %.2f degrees\n",-angle,-warp);
+       glRotatef( (angle+warp), 0.0, 0.0, -1.0 );
+       printf("Rotating stars by %.2f degrees + %.2f degrees\n",angle,warp);
 
        glCallList(stars[i]);
 
@@ -252,9 +254,12 @@ void fgStarsRender() {
 
 
 /* $Log$
-/* Revision 1.10  1997/09/20 03:34:32  curt
-/* Still trying to get those durned stars aligned properly.
+/* Revision 1.11  1997/09/22 14:44:21  curt
+/* Continuing to try to align stars correctly.
 /*
+ * Revision 1.10  1997/09/20 03:34:32  curt
+ * Still trying to get those durned stars aligned properly.
+ *
  * Revision 1.9  1997/09/18 16:20:09  curt
  * At dusk/dawn add/remove stars in stages.
  *
index 023960526b19c58d9ea820c47d032cc1349fc965..88de7e487583e3b1a805ec030157b87dd14f9a7b 100644 (file)
@@ -56,12 +56,21 @@ clean:
 
 include depend
 
+fg_time.o:
+       $(CC) $(CFLAGS) -c fg_time.c -o $@
+
 fg_timer.o:
        $(CC) $(CFLAGS) -c fg_timer.c -o $@
 
+sunpos.o:
+       $(CC) $(CFLAGS) -c sunpos.c -o $@
+
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.13  1997/09/22 14:44:22  curt
+# Continuing to try to align stars correctly.
+#
 # Revision 1.12  1997/08/06 00:24:31  curt
 # Working on correct real time sun lighting.
 #
index ab061cf3d7e2cdd9723f3b9798629abddca0a451..a4cdb8767e47628c8de24a136ec7e86ffc5f4dda 100644 (file)
@@ -2,7 +2,7 @@ fg_time.o: fg_time.c fg_time.h ../types.h ../Flight/flight.h \
  ../Flight/Slew/slew.h ../Flight/LaRCsim/ls_interface.h \
  ../Flight/LaRCsim/../flight.h ../constants.h ../Time/fg_time.h
 fg_timer.o: fg_timer.c fg_timer.h
-sidereal.o: sidereal.c ../constants.h
+sptest.o: sptest.c sunpos.h ../types.h ../constants.h
 sunpos.o: sunpos.c sunpos.h ../types.h fg_time.h ../Flight/flight.h \
  ../Flight/Slew/slew.h ../Flight/LaRCsim/ls_interface.h \
  ../Flight/LaRCsim/../flight.h ../constants.h ../GLUT/views.h \