../Scenery/scenery.h ../Scenery/../Include/types.h ../Math/mat3.h \
../Math/polar.h ../Math/../Include/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/../Include/limits.h ../Flight/flight.h \
- ../Controls/controls.h ../Include/constants.h ../Scenery/mesh.h \
- ../Scenery/scenery.h ../Scenery/../Include/types.h ../Math/mat3.h \
- ../Math/polar.h ../Math/../Include/types.h ../Time/fg_timer.h \
- ../Math/fg_random.h ../Weather/weather.h
#include "../Math/mat3.h"
#include "../Math/polar.h"
#include "../Scenery/mesh.h"
+#include "../Scenery/moon.h"
#include "../Scenery/scenery.h"
#include "../Scenery/sky.h"
+#include "../Scenery/stars.h"
+#include "../Scenery/sun.h"
#include "../Time/fg_time.h"
#include "../Time/fg_timer.h"
#include "../Time/sunpos.h"
t = &cur_time_params;
w = ¤t_weather;
- xglEnable( GL_DEPTH_TEST );
- /* xglFrontFace(GL_CW); */
- xglEnable( GL_CULL_FACE );
/* xglDisable( GL_DITHER ); */
**************************************************************************/
static void fgUpdateVisuals( void ) {
+ struct fgTIME *t;
+ struct fgVIEW *v;
+ double angle;
+ static double lastAstroUpdate = 0;
+
+ t = &cur_time_params;
+ v = ¤t_view;
+
/* update view volume parameters */
fgUpdateViewParams();
- xglClear( /* GL_COLOR_BUFFER_BIT | */ GL_DEPTH_BUFFER_BIT );
+ xglClear( GL_DEPTH_BUFFER_BIT /* | GL_COLOR_BUFFER_BIT */ );
/* Tell GL we are switching to model view parameters */
xglMatrixMode(GL_MODELVIEW);
/* xglLoadIdentity(); */
/* draw sky */
+ xglDisable( GL_DEPTH_TEST );
+ xglDisable( GL_LIGHTING );
+ xglDisable( GL_CULL_FACE );
+ xglShadeModel( GL_SMOOTH );
fgSkyRender();
- /* draw astronomical objects */
- /* fgAstroRender(); */
-
+ /* a hack: Force sun and moon position to be updated on an hourly basis */
+ if (((t->gst - lastAstroUpdate) > 1) || (t->gst < lastAstroUpdate)) {
+ lastAstroUpdate = t->gst;
+ fgSunInit();
+ fgMoonInit();
+ }
+
+ /* setup transformation for drawing astronomical objects */
+ xglPushMatrix();
+ /* Translate to view position */
+ xglTranslatef( v->view_pos.x, v->view_pos.y, v->view_pos.z );
+ /* Rotate based on gst (side real time) */
+ angle = t->gst * 15.041085; /* should be 15.041085, Curt thought it was 15*/
+ /* printf("Rotating astro objects by %.2f degrees\n",angle); */
+ xglRotatef( angle, 0.0, 0.0, -1.0 );
+
+ /* draw stars and planets */
+ xglDisable( GL_FOG );
+ fgStarsRender();
+
+ /* draw the sun */
+ fgSunRender();
+
+ /* render the moon */
+ xglEnable( GL_LIGHTING );
+ xglEnable( GL_CULL_FACE );
+ fgMoonRender();
+
+ xglPopMatrix();
+
/* draw scenery */
+ xglShadeModel( GL_FLAT );
+ xglEnable( GL_DEPTH_TEST );
+ xglEnable( GL_FOG );
fgSceneryRender();
/* display HUD */
/* $Log$
-/* Revision 1.35 1997/12/18 23:32:32 curt
-/* First stab at sky dome actually starting to look reasonable. :-)
+/* Revision 1.36 1997/12/19 16:44:57 curt
+/* Working on scene rendering order and options.
/*
+ * Revision 1.35 1997/12/18 23:32:32 curt
+ * First stab at sky dome actually starting to look reasonable. :-)
+ *
* Revision 1.34 1997/12/17 23:13:34 curt
* Began working on rendering a sky.
*
-GLUTkey.o: GLUTkey.c GLUTkey.h views.h ../Include/types.h \
+GLUTkey.o: GLUTkey.c ../XGL/xgl.h GLUTkey.h views.h ../Include/types.h \
../Flight/flight.h ../Flight/Slew/slew.h \
../Flight/LaRCsim/ls_interface.h ../Flight/LaRCsim/../flight.h \
../Math/mat3.h ../Include/constants.h ../Aircraft/aircraft.h \
../Aircraft/../Flight/flight.h ../Aircraft/../Controls/controls.h \
../Aircraft/../Controls/../Include/limits.h ../Weather/weather.h
-GLUTmain.o: GLUTmain.c GLUTkey.h fg_init.h views.h ../Include/types.h \
- ../Flight/flight.h ../Flight/Slew/slew.h \
+GLUTmain.o: GLUTmain.c ../XGL/xgl.h GLUTkey.h fg_init.h views.h \
+ ../Include/types.h ../Flight/flight.h ../Flight/Slew/slew.h \
../Flight/LaRCsim/ls_interface.h ../Flight/LaRCsim/../flight.h \
../Math/mat3.h ../Include/constants.h ../Include/general.h \
../Aircraft/aircraft.h ../Aircraft/../Flight/flight.h \
../Cockpit/hud.h ../Cockpit/../Aircraft/aircraft.h \
../Cockpit/../Flight/flight.h ../Cockpit/../Controls/controls.h \
../Joystick/joystick.h ../Math/fg_geodesy.h ../Math/polar.h \
- ../Math/../Include/types.h ../Scenery/mesh.h ../Scenery/scenery.h \
- ../Scenery/../Include/types.h ../Time/fg_time.h \
- ../Time/../Include/types.h ../Time/../Flight/flight.h \
- ../Time/fg_timer.h ../Time/sunpos.h ../Weather/weather.h
+ ../Math/../Include/types.h ../Scenery/mesh.h ../Scenery/moon.h \
+ ../Scenery/orbits.h ../Scenery/../Time/fg_time.h \
+ ../Scenery/../Time/../Include/types.h \
+ ../Scenery/../Time/../Flight/flight.h ../Scenery/scenery.h \
+ ../Scenery/../Include/types.h ../Scenery/sky.h ../Scenery/stars.h \
+ ../Scenery/sun.h ../Time/fg_time.h ../Time/fg_timer.h \
+ ../Time/sunpos.h ../Time/../Include/types.h ../Weather/weather.h
fg_init.o: fg_init.c fg_init.h views.h ../Include/types.h \
../Flight/flight.h ../Flight/Slew/slew.h \
../Flight/LaRCsim/ls_interface.h ../Flight/LaRCsim/../flight.h \
../Cockpit/hud.h ../Cockpit/../Aircraft/aircraft.h \
../Cockpit/../Flight/flight.h ../Cockpit/../Controls/controls.h \
../Joystick/joystick.h ../Math/fg_random.h ../Scenery/mesh.h \
- ../Scenery/astro.h ../Scenery/stars.h ../Scenery/scenery.h \
- ../Scenery/../Include/types.h ../Time/fg_time.h \
- ../Time/../Include/types.h ../Time/../Flight/flight.h \
- ../Time/sunpos.h ../Weather/weather.h
+ ../Scenery/moon.h ../Scenery/orbits.h ../Scenery/../Time/fg_time.h \
+ ../Scenery/../Time/../Include/types.h \
+ ../Scenery/../Time/../Flight/flight.h ../Scenery/scenery.h \
+ ../Scenery/../Include/types.h ../Scenery/sky.h ../Scenery/stars.h \
+ ../Scenery/sun.h ../Time/fg_time.h ../Time/sunpos.h \
+ ../Time/../Include/types.h ../Weather/weather.h
views.o: views.c views.h ../Include/types.h ../Flight/flight.h \
../Flight/Slew/slew.h ../Flight/LaRCsim/ls_interface.h \
../Flight/LaRCsim/../flight.h ../Math/mat3.h ../Include/constants.h \
#include "../Joystick/joystick.h"
#include "../Math/fg_random.h"
#include "../Scenery/mesh.h"
-#include "../Scenery/astro.h"
+#include "../Scenery/moon.h"
#include "../Scenery/scenery.h"
#include "../Scenery/sky.h"
+#include "../Scenery/stars.h"
+#include "../Scenery/sun.h"
#include "../Time/fg_time.h"
#include "../Time/sunpos.h"
#include "../Weather/weather.h"
}
*/
- /* Initialize Astronomical Objects */
- fgAstroInit();
+ /* Initialize the orbital elements of sun, moon and mayor planets */
+ fgSolarSystemInit(*t);
+
+ /* Initialize the Stars subsystem */
+ fgStarsInit();
+
+ /* Initialize the sun's position */
+ fgSunInit();
+
+ /* Intialize the moon's position */
+ fgMoonInit();
/* Initialize the "sky" */
fgSkyInit();
/* $Log$
-/* Revision 1.20 1997/12/18 23:32:33 curt
-/* First stab at sky dome actually starting to look reasonable. :-)
+/* Revision 1.21 1997/12/19 16:45:00 curt
+/* Working on scene rendering order and options.
/*
+ * Revision 1.20 1997/12/18 23:32:33 curt
+ * First stab at sky dome actually starting to look reasonable. :-)
+ *
* Revision 1.19 1997/12/17 23:13:36 curt
* Began working on rendering a sky.
*
TARGET = libScenery.a
-CFILES = astro.c common.c geometry.c mesh.c moon.c obj.c orbits.c planets.c \
+CFILES = common.c geometry.c mesh.c moon.c obj.c orbits.c planets.c \
scenery.c sky.c stars.c sun.c
OFILES = $(CFILES:.c=.o)
#---------------------------------------------------------------------------
# $Log$
+# Revision 1.26 1997/12/19 16:45:01 curt
+# Working on scene rendering order and options.
+#
# Revision 1.25 1997/12/17 23:13:45 curt
# Began working on rendering the sky.
#
fgMoonInit();
}
- /* Disable fog effects */
- xglDisable( GL_FOG );
-
/* set the sun position */
/* xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec_inv ); */
fgSunRender();
xglPopMatrix();
-
- /* reenable fog effects */
- xglEnable( GL_FOG );
}
/* $Log$
-/* Revision 1.9 1997/12/18 23:32:35 curt
-/* First stab at sky dome actually starting to look reasonable. :-)
+/* Revision 1.10 1997/12/19 16:45:01 curt
+/* Working on scene rendering order and options.
/*
+ * Revision 1.9 1997/12/18 23:32:35 curt
+ * First stab at sky dome actually starting to look reasonable. :-)
+ *
* Revision 1.8 1997/12/15 23:54:57 curt
* Add xgl wrappers for debugging.
* Generate terrain normals on the fly.
-astro.o: astro.c astro.h stars.h moon.h orbits.h ../Time/fg_time.h \
- ../Time/../Include/types.h ../Time/../Flight/flight.h \
- ../Time/../Flight/Slew/slew.h \
+astro.o: astro.c ../XGL/xgl.h astro.h stars.h moon.h orbits.h \
+ ../Time/fg_time.h ../Time/../Include/types.h \
+ ../Time/../Flight/flight.h ../Time/../Flight/Slew/slew.h \
../Time/../Flight/LaRCsim/ls_interface.h \
../Time/../Flight/LaRCsim/../flight.h planets.h sun.h \
../Include/constants.h ../Include/general.h ../Main/views.h \
mesh.o: mesh.c ../Include/constants.h ../Include/types.h \
../Math/fg_geodesy.h ../Math/fg_random.h ../Math/mat3.h \
../Math/polar.h ../Math/../Include/types.h mesh.h common.h scenery.h
-moon.o: moon.c orbits.h ../Time/fg_time.h ../Time/../Include/types.h \
- ../Time/../Flight/flight.h ../Time/../Flight/Slew/slew.h \
+moon.o: moon.c ../XGL/xgl.h orbits.h ../Time/fg_time.h \
+ ../Time/../Include/types.h ../Time/../Flight/flight.h \
+ ../Time/../Flight/Slew/slew.h \
../Time/../Flight/LaRCsim/ls_interface.h \
../Time/../Flight/LaRCsim/../flight.h moon.h ../Include/general.h \
../Main/views.h ../Main/../Include/types.h ../Main/../Flight/flight.h \
../Main/../Math/mat3.h
-obj.o: obj.c obj.h scenery.h ../Include/types.h ../Math/mat3.h
+obj.o: obj.c ../XGL/xgl.h obj.h scenery.h ../Include/types.h \
+ ../Math/mat3.h
orbits.o: orbits.c orbits.h ../Time/fg_time.h \
../Time/../Include/types.h ../Time/../Flight/flight.h \
../Time/../Flight/Slew/slew.h \
../Time/../Flight/flight.h ../Time/../Flight/Slew/slew.h \
../Time/../Flight/LaRCsim/ls_interface.h \
../Time/../Flight/LaRCsim/../flight.h orbits.h planets.h sun.h
-scenery.o: scenery.c ../Include/general.h astro.h stars.h obj.h \
- scenery.h ../Include/types.h
-stars.o: stars.c orbits.h ../Time/fg_time.h ../Time/../Include/types.h \
- ../Time/../Flight/flight.h ../Time/../Flight/Slew/slew.h \
+scenery.o: scenery.c ../XGL/xgl.h ../Include/general.h astro.h stars.h \
+ obj.h scenery.h ../Include/types.h
+sky.o: sky.c ../XGL/xgl.h sky.h ../Time/fg_time.h \
+ ../Time/../Include/types.h ../Time/../Flight/flight.h \
+ ../Time/../Flight/Slew/slew.h \
+ ../Time/../Flight/LaRCsim/ls_interface.h \
+ ../Time/../Flight/LaRCsim/../flight.h ../Aircraft/aircraft.h \
+ ../Aircraft/../Flight/flight.h ../Aircraft/../Controls/controls.h \
+ ../Aircraft/../Controls/../Include/limits.h ../Flight/flight.h \
+ ../Include/constants.h ../Main/views.h ../Main/../Include/types.h \
+ ../Main/../Flight/flight.h ../Main/../Math/mat3.h ../Math/fg_random.h
+stars.o: stars.c ../XGL/xgl.h orbits.h ../Time/fg_time.h \
+ ../Time/../Include/types.h ../Time/../Flight/flight.h \
+ ../Time/../Flight/Slew/slew.h \
../Time/../Flight/LaRCsim/ls_interface.h \
../Time/../Flight/LaRCsim/../flight.h planets.h stars.h \
../Include/constants.h ../Include/general.h ../Aircraft/aircraft.h \
../Aircraft/../Controls/../Include/limits.h ../Main/views.h \
../Main/../Include/types.h ../Main/../Flight/flight.h \
../Main/../Math/mat3.h
-sun.o: sun.c ../Time/fg_time.h ../Time/../Include/types.h \
+sun.o: sun.c ../XGL/xgl.h ../Time/fg_time.h ../Time/../Include/types.h \
../Time/../Flight/flight.h ../Time/../Flight/Slew/slew.h \
../Time/../Flight/LaRCsim/ls_interface.h \
../Time/../Flight/LaRCsim/../flight.h ../Main/views.h \
cos(moonPos.Declination);
zMoon = 60000.0 * sin(moonPos.Declination);
- glutSolidSphere(1.0, 15, 15);
+ glutSolidSphere(1.0, 10, 10);
xglEndList();
}
printf("Rendering the sky.\n");
- xglDisable( GL_LIGHTING );
- xglDisable( GL_CULL_FACE );
- xglShadeModel( GL_SMOOTH );
-
xglPushMatrix();
/* Translate to view position */
xglEnd();
xglPopMatrix();
-
- xglShadeModel( GL_FLAT );
- xglEnable( GL_CULL_FACE );
- xglEnable( GL_LIGHTING );
}
/* $Log$
-/* Revision 1.3 1997/12/18 23:32:36 curt
-/* First stab at sky dome actually starting to look reasonable. :-)
+/* Revision 1.4 1997/12/19 16:45:02 curt
+/* Working on scene rendering order and options.
/*
+ * Revision 1.3 1997/12/18 23:32:36 curt
+ * First stab at sky dome actually starting to look reasonable. :-)
+ *
* Revision 1.2 1997/12/18 04:07:03 curt
* Worked on properly translating and positioning the sky dome.
*
../Flight/LaRCsim/../flight.h ../Include/constants.h \
../Time/fg_time.h
fg_timer.o: fg_timer.c fg_timer.h
-sidereal.o: sidereal.c ../Include/constants.h
+sptest.o: sptest.c sunpos.h ../Include/types.h ../Include/constants.h
sunpos.o: sunpos.c sunpos.h ../Include/types.h fg_time.h \
../Flight/flight.h ../Flight/Slew/slew.h \
../Flight/LaRCsim/ls_interface.h ../Flight/LaRCsim/../flight.h \