From: curt Date: Wed, 17 Dec 1997 23:13:34 +0000 (+0000) Subject: Began working on rendering a sky. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=edc601667a9bbc3b76d562cc7ab53bc063fda7c7;p=flightgear.git Began working on rendering a sky. --- diff --git a/Main/GLUTmain.c b/Main/GLUTmain.c index da730f6d4..6a7a3119b 100644 --- a/Main/GLUTmain.c +++ b/Main/GLUTmain.c @@ -47,6 +47,7 @@ #include "../Math/polar.h" #include "../Scenery/mesh.h" #include "../Scenery/scenery.h" +#include "../Scenery/sky.h" #include "../Time/fg_time.h" #include "../Time/fg_timer.h" #include "../Time/sunpos.h" @@ -226,6 +227,9 @@ static void fgUpdateVisuals( void ) { xglMatrixMode(GL_MODELVIEW); /* xglLoadIdentity(); */ + /* draw sky */ + fgSkyRender(); + /* draw scenery */ fgSceneryRender(); @@ -565,10 +569,13 @@ int main( int argc, char *argv[] ) { /* $Log$ -/* Revision 1.33 1997/12/15 23:54:45 curt -/* Add xgl wrappers for debugging. -/* Generate terrain normals on the fly. +/* Revision 1.34 1997/12/17 23:13:34 curt +/* Began working on rendering a sky. /* + * Revision 1.33 1997/12/15 23:54:45 curt + * Add xgl wrappers for debugging. + * Generate terrain normals on the fly. + * * Revision 1.32 1997/12/15 20:59:08 curt * Misc. tweaks. * diff --git a/Main/Makefile b/Main/Makefile index d1a06e158..6755ea934 100644 --- a/Main/Makefile +++ b/Main/Makefile @@ -49,6 +49,7 @@ TARGET=fg-$(FG_VERSION) $(TARGET): $(OFILES) $(AFILES) $(CC) -o $(TARGET) $(OFILES) $(AFILES) $(LIBS) + $(RM) -f fg$(FG_VERSION_MAJOR) $(LN) $(TARGET) fg$(FG_VERSION_MAJOR) all: $(TARGET) @@ -83,6 +84,9 @@ views.o: #--------------------------------------------------------------------------- # $Log$ +# Revision 1.39 1997/12/17 23:13:35 curt +# Began working on rendering a sky. +# # Revision 1.38 1997/12/15 23:54:47 curt # Add xgl wrappers for debugging. # Generate terrain normals on the fly. diff --git a/Main/fg_init.c b/Main/fg_init.c index 7edcb27ce..cc58abc7b 100644 --- a/Main/fg_init.c +++ b/Main/fg_init.c @@ -40,6 +40,7 @@ #include "../Scenery/mesh.h" #include "../Scenery/astro.h" #include "../Scenery/scenery.h" +#include "../Scenery/sky.h" #include "../Time/fg_time.h" #include "../Time/sunpos.h" #include "../Weather/weather.h" @@ -179,6 +180,9 @@ void fgInitSubsystems( void ) { /* Initialize Astronomical Objects */ fgAstroInit(); + /* Initialize the "sky" */ + fgSkyInit(); + /* Initialize the Scenery Management subsystem */ fgSceneryInit(); @@ -218,10 +222,13 @@ void fgInitSubsystems( void ) { /* $Log$ -/* Revision 1.18 1997/12/15 23:54:49 curt -/* Add xgl wrappers for debugging. -/* Generate terrain normals on the fly. +/* Revision 1.19 1997/12/17 23:13:36 curt +/* Began working on rendering a sky. /* + * Revision 1.18 1997/12/15 23:54:49 curt + * Add xgl wrappers for debugging. + * Generate terrain normals on the fly. + * * Revision 1.17 1997/12/15 20:59:09 curt * Misc. tweaks. * diff --git a/Main/views.c b/Main/views.c index 96cdc71bf..c55ce750a 100644 --- a/Main/views.c +++ b/Main/views.c @@ -50,6 +50,10 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v) { MAT3vec vec, forward; MAT3mat R, TMP, UP, LOCAL, VIEW; + /* calculate the cartesion coords of the current lat/lon/0 elev */ + v->cur_zero_elev = fgPolarToCart(FG_Longitude, FG_Lat_geocentric, + FG_Sea_level_radius); + /* calculate view position in current FG view coordinate system */ v->view_pos = fgPolarToCart(FG_Longitude, FG_Lat_geocentric, FG_Radius_to_vehicle * FEET_TO_METER + 1.0); @@ -133,10 +137,13 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v) { /* $Log$ -/* Revision 1.3 1997/12/15 23:54:50 curt -/* Add xgl wrappers for debugging. -/* Generate terrain normals on the fly. +/* Revision 1.4 1997/12/17 23:13:36 curt +/* Began working on rendering a sky. /* + * Revision 1.3 1997/12/15 23:54:50 curt + * Add xgl wrappers for debugging. + * Generate terrain normals on the fly. + * * Revision 1.2 1997/12/10 22:37:48 curt * Prepended "fg" on the name of all global structures that didn't have it yet. * i.e. "struct WEATHER {}" became "struct fgWEATHER {}" diff --git a/Main/views.h b/Main/views.h index 9dc0bfff4..9e5d6a053 100644 --- a/Main/views.h +++ b/Main/views.h @@ -36,6 +36,7 @@ /* Define a structure containing view information */ struct fgVIEW { struct fgCartesianPoint view_pos; + struct fgCartesianPoint cur_zero_elev; MAT3vec local_up, view_up, view_forward; double view_offset, goal_view_offset; }; @@ -55,10 +56,13 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v); /* $Log$ -/* Revision 1.3 1997/12/15 23:54:51 curt -/* Add xgl wrappers for debugging. -/* Generate terrain normals on the fly. +/* Revision 1.4 1997/12/17 23:13:36 curt +/* Began working on rendering a sky. /* + * Revision 1.3 1997/12/15 23:54:51 curt + * Add xgl wrappers for debugging. + * Generate terrain normals on the fly. + * * Revision 1.2 1997/12/10 22:37:48 curt * Prepended "fg" on the name of all global structures that didn't have it yet. * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"