]> git.mxchange.org Git - flightgear.git/commitdiff
More light/material property tweaking ... still a ways off.
authorcurt <curt>
Fri, 12 Dec 1997 21:41:24 +0000 (21:41 +0000)
committercurt <curt>
Fri, 12 Dec 1997 21:41:24 +0000 (21:41 +0000)
Main/GLUTmain.c
Main/Makefile
Scenery/astro.c
Scenery/moon.c
Scenery/obj.c
Scenery/planets.c
Scenery/planets.h
Scenery/scenery.c
Scenery/sun.c
Simulator/make.inc
Time/fg_time.c

index cea1a88e92a2cd0036ded2cc38e01ebaacd7b49c..f81cb95821da1e6791d375afdb54bc3f7c87bc4d 100644 (file)
@@ -176,7 +176,7 @@ static void fgUpdateViewParams() {
 
     light = pow(1.1, -x_10 / 30.0);
     ambient = 0.3 * light;
-    diffuse = 0.7 * light;
+    diffuse = 0.9 * light;
 
     sky_brightness = 0.85 * pow(1.2, -x_8 / 20.0) + 0.15;
 
@@ -570,9 +570,12 @@ int main( int argc, char *argv[] ) {
 
 
 /* $Log$
-/* Revision 1.30  1997/12/12 19:52:47  curt
-/* Working on lightling and material properties.
+/* Revision 1.31  1997/12/12 21:41:25  curt
+/* More light/material property tweaking ... still a ways off.
 /*
+ * Revision 1.30  1997/12/12 19:52:47  curt
+ * Working on lightling and material properties.
+ *
  * Revision 1.29  1997/12/11 04:43:54  curt
  * Fixed sun vector and lighting problems.  I thing the moon is now lit
  * correctly.
index ccd4fc5c9221ac35a283ef78138549c8712c3801..2a0d40dae30a399badf5dc0bc635fbafd97c47c0 100644 (file)
@@ -40,7 +40,7 @@ CFLAGS = $(FG_CFLAGS) $(INTERFACE_FLAGS)
 LIBS =  $(INTERFACE_LIBS) $(GRAPHICS_LIBS) -lm -lfl
 
 
-TARGET=fg-$(VERSION)
+TARGET=fg-$(FG_VERSION)
 
 
 #---------------------------------------------------------------------------
@@ -49,13 +49,14 @@ TARGET=fg-$(VERSION)
 
 $(TARGET): $(OFILES) $(AFILES)
        $(CC) -o $(TARGET) $(OFILES) $(AFILES) $(LIBS)
-       $(LN) $(TARGET) fg$(VERSION_MAJOR)
+       $(LN) $(TARGET) fg$(FG_VERSION_MAJOR)
 
 all: $(TARGET)
 
 clean:
        rm -f *.o $(TARGET) $(TARGET).exe \
-               fg$(VERSION_MAJOR) fg$(VERSION_MAJOR).exe lib*.a *.os2 *~ core
+               fg$(FG_VERSION_MAJOR) fg$(FG_VERSION_MAJOR).exe \
+               lib*.a *.os2 *~ core
 
 
 #---------------------------------------------------------------------------
@@ -82,6 +83,9 @@ views.o:
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.37  1997/12/12 21:41:26  curt
+# More light/material property tweaking ... still a ways off.
+#
 # Revision 1.36  1997/12/10 01:19:47  curt
 # Tweaks for verion 0.15 release.
 #
index bf5cd5e389d03bde4abfc5f3533847565332969a..f742a1b51fe9677b0da5dcc01d272d4d68920a97 100644 (file)
@@ -55,14 +55,14 @@ void fgAstroInit() {
     /* Initialize the orbital elements of sun, moon and mayor planets */
     fgSolarSystemInit(*t);
 
-    /* Intialize the moon's position */
-    fgMoonInit(); 
+    /* Initialize the Stars subsystem  */
+    fgStarsInit();             
 
     /* Initialize the sun's position */
     fgSunInit();       
 
-    /* Initialize the Stars subsystem  */
-    fgStarsInit();             
+    /* Intialize the moon's position */
+    fgMoonInit(); 
 }
 
 
@@ -107,12 +107,12 @@ void fgAstroRender() {
     /* render the stars */
     fgStarsRender();
 
-    /* render the moon */
-    fgMoonRender();
-
     /* render the sun */
     fgSunRender();
 
+    /* render the moon */
+    fgMoonRender();
+
     glPopMatrix();
 
     /* reenable fog effects */
@@ -121,9 +121,12 @@ void fgAstroRender() {
 
 
 /* $Log$
-/* Revision 1.5  1997/12/12 19:52:54  curt
-/* Working on lightling and material properties.
+/* Revision 1.6  1997/12/12 21:41:27  curt
+/* More light/material property tweaking ... still a ways off.
 /*
+ * Revision 1.5  1997/12/12 19:52:54  curt
+ * Working on lightling and material properties.
+ *
  * Revision 1.4  1997/12/11 04:43:56  curt
  * Fixed sun vector and lighting problems.  I thing the moon is now lit
  * correctly.
index f9ce58bb1df49af0edae78be7fe3ed43f02b07ae..2cbaf79194c07429ba688194454eed970f35375d 100644 (file)
@@ -147,11 +147,11 @@ struct CelestialCoord fgCalculateMoon(struct OrbElements params,
                                       struct OrbElements sunParams,
                                       struct fgTIME t)
 {
-       struct CelestialCoord
-          result;
-
+    struct CelestialCoord
+       result;
+    
     double
-         eccAnom, ecl, lonecl, latecl, actTime,
+       eccAnom, ecl, lonecl, latecl, actTime,
         xv, yv, v, r, xh, yh, zh, xg, yg, zg, xe, ye, ze,
         Ls, Lm, D, F;
 
@@ -226,7 +226,6 @@ struct CelestialCoord fgCalculateMoon(struct OrbElements params,
 
 void fgMoonInit() {
     struct fgLIGHT *l;
-    static GLfloat moon_color[4] = { 1.0, 1.0, 1.0, 1.0 };
 //   int i;
 
     l = &cur_light_params;
@@ -262,6 +261,7 @@ void fgMoonInit() {
 /* Draw the moon */
 void fgMoonRender() {
     struct fgLIGHT *l;
+    GLfloat black[4] = { 0.0, 0.0, 0.0, 1.0 };
     GLfloat moon_color[4] = { 1.0, 1.0, 1.0, 1.0 };
 
     l = &cur_light_params;
@@ -270,11 +270,14 @@ void fgMoonRender() {
     glLightfv(GL_LIGHT0, GL_AMBIENT, l->scene_clear );
     glLightfv(GL_LIGHT0, GL_DIFFUSE, moon_color );
 
+    glMaterialfv(GL_FRONT, GL_AMBIENT, black);
+    glMaterialfv(GL_FRONT, GL_DIFFUSE, moon_color);
+
     glPushMatrix();
     glTranslatef(xMoon, yMoon, zMoon);
     glScalef(1400, 1400, 1400);
 
-    /* glColor3fv(color); */
+    glColor3fv(moon_color);
     /* glutSolidSphere(1.0, 25, 25); */
     glCallList(moon);
 
index 1fd44a582688d28b7fb672dc464d203ebd73bbcb..11b12155ee887733e9d839c2626f741441cced31 100644 (file)
@@ -48,9 +48,6 @@ float normals[MAXNODES][3];
 /* Load a .obj file and generate the GL call list */
 GLint fgObjLoad(char *path) {
     char line[256], winding[256];
-    static GLfloat terrain_color[4] = { 0.6, 0.6, 0.25, 1.0 };
-    static GLfloat terrain_ambient[4];
-    static GLfloat terrain_diffuse[4];
     double v1[3], v2[3], approx_normal[3], dot_prod, temp;
     struct fgCartesianPoint ref;
     GLint area;
@@ -66,14 +63,6 @@ GLint fgObjLoad(char *path) {
     area = glGenLists(1);
     glNewList(area, GL_COMPILE);
 
-    for ( i = 0; i < 4; i++ ) {
-       terrain_ambient[i] = terrain_color[i];
-       terrain_diffuse[i] = terrain_color[i];
-    }
-
-    glMaterialfv(GL_FRONT, GL_AMBIENT, terrain_ambient);
-    glMaterialfv(GL_FRONT, GL_DIFFUSE, terrain_diffuse);
-
     first = 1;
     ncount = 1;
     vncount = 1;
@@ -259,9 +248,12 @@ GLint fgObjLoad(char *path) {
 
 
 /* $Log$
-/* Revision 1.9  1997/12/12 19:52:57  curt
-/* Working on lightling and material properties.
+/* Revision 1.10  1997/12/12 21:41:28  curt
+/* More light/material property tweaking ... still a ways off.
 /*
+ * Revision 1.9  1997/12/12 19:52:57  curt
+ * Working on lightling and material properties.
+ *
  * Revision 1.8  1997/12/10 01:19:51  curt
  * Tweaks for verion 0.15 release.
  *
index 9f7911a016e788a9aa61e0940bb8f94d906fc7f0..b4e2bb1641028167bf23a2e3e0f23294b6f1d3ac 100644 (file)
@@ -30,7 +30,7 @@
 
 
 struct CelestialCoord fgCalculatePlanet(struct OrbElements planet,
-                                        struct OrbElements sun,
+                                        struct OrbElements theSun,
                                         struct fgTIME t)
 {
    struct CelestialCoord
@@ -70,7 +70,7 @@ struct CelestialCoord fgCalculatePlanet(struct OrbElements planet,
     */
     /* calculate the solar position */
 
-       SolarPosition = fgCalcSunPos(sun);
+    SolarPosition = fgCalcSunPos(theSun);
     xg = xh + SolarPosition.xs;
     yg = yh + SolarPosition.ys;
     zg = zh;
@@ -85,7 +85,10 @@ struct CelestialCoord fgCalculatePlanet(struct OrbElements planet,
 
 
 /* $Log$
-/* Revision 1.1  1997/10/25 03:16:10  curt
-/* Initial revision of code contributed by Durk Talsma.
+/* Revision 1.2  1997/12/12 21:41:29  curt
+/* More light/material property tweaking ... still a ways off.
 /*
+ * Revision 1.1  1997/10/25 03:16:10  curt
+ * Initial revision of code contributed by Durk Talsma.
+ *
  */
index e0ce0541ee1c276454c9b15138e72670d5720d2d..dfbc35fe727d52c5887a859202861ffd0ad5f77f 100644 (file)
 
 
 struct CelestialCoord fgCalculatePlanet(struct OrbElements planet,
-                                         struct OrbElements sun,
+                                         struct OrbElements theSun,
                                          struct fgTIME t);
 
 #endif /* PLANETS_H */
 
 
 /* $Log$
-/* Revision 1.1  1997/10/25 03:16:11  curt
-/* Initial revision of code contributed by Durk Talsma.
+/* Revision 1.2  1997/12/12 21:41:30  curt
+/* More light/material property tweaking ... still a ways off.
 /*
+ * Revision 1.1  1997/10/25 03:16:11  curt
+ * Initial revision of code contributed by Durk Talsma.
+ *
  */
index fb7c570f7e7ba6aa637eb019e3424185cd7fd01a..003920123091a3cf87350352c693f6044c17c758 100644 (file)
@@ -80,14 +80,30 @@ void fgSceneryUpdate(double lon, double lat, double elev) {
 
 /* Render out the current scene */
 void fgSceneryRender() {
+    static GLfloat terrain_color[4] = { 0.4, 0.8, 0.3, 1.0 };
+    static GLfloat terrain_ambient[4];
+    static GLfloat terrain_diffuse[4];
+    int i;
+
+    for ( i = 0; i < 4; i++ ) {
+       terrain_ambient[i] = terrain_color[i];
+       terrain_diffuse[i] = terrain_color[i];
+    }
+
+    glMaterialfv(GL_FRONT, GL_AMBIENT, terrain_ambient);
+    glMaterialfv(GL_FRONT, GL_DIFFUSE, terrain_diffuse);
+
     glCallList(area_terrain);
 }
 
 
 /* $Log$
-/* Revision 1.26  1997/12/12 19:52:58  curt
-/* Working on lightling and material properties.
+/* Revision 1.27  1997/12/12 21:41:30  curt
+/* More light/material property tweaking ... still a ways off.
 /*
+ * Revision 1.26  1997/12/12 19:52:58  curt
+ * Working on lightling and material properties.
+ *
  * Revision 1.25  1997/12/10 22:37:51  curt
  * Prepended "fg" on the name of all global structures that didn't have it yet.
  * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
index 9702ffedb6c0196511c768fbe2e8d8de62cefdb3..2b97740cf3ecb10588cd59bc4b778677591cf2ac 100644 (file)
@@ -28,7 +28,7 @@
 #include "orbits.h"
 #include "sun.h"
 
-GLint sun;
+GLint sun_obj;
 
 static struct CelestialCoord sunPos;
 
@@ -95,8 +95,8 @@ void fgSunInit()
 {
 //   int i;
 
-    sun = glGenLists(1);
-    glNewList(sun, GL_COMPILE );
+    sun_obj = glGenLists(1);
+    glNewList(sun_obj, GL_COMPILE );
 
 //     glBegin( GL_POINTS );
 
@@ -136,7 +136,6 @@ void fgSunInit()
 //     glEnd();
     //glPopMatrix();
 
-    glColor3f(0.85, 0.65, 0.05);
     glutSolidSphere(1.0, 10, 10);
 
     glEndList();
@@ -190,9 +189,11 @@ void fgSunRender() {
     glTranslatef(xSun, ySun, zSun);
     glScalef(1400, 1400, 1400);
 
+    glColor3f(0.85, 0.65, 0.05);
+
     /* glColor3fv( color ); */
     /* glutSolidSphere(1.0, 25, 25); */
-    glCallList(sun);
+    glCallList(sun_obj);
 
     glPopMatrix();
 
@@ -201,10 +202,13 @@ void fgSunRender() {
 
 
 /* $Log$
-/* Revision 1.4  1997/12/10 22:37:53  curt
-/* Prepended "fg" on the name of all global structures that didn't have it yet.
-/* i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
+/* Revision 1.5  1997/12/12 21:41:31  curt
+/* More light/material property tweaking ... still a ways off.
 /*
+ * Revision 1.4  1997/12/10 22:37:53  curt
+ * Prepended "fg" on the name of all global structures that didn't have it yet.
+ * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
+ *
  * Revision 1.3  1997/12/09 05:11:56  curt
  * Working on tweaking lighting.
  *
index 85a542653aaf21f560aa4dcef8b12ccb308f009f..171e041293d01982b9b2cf8935590723fb132763 100644 (file)
@@ -93,6 +93,18 @@ GLOBAL_CFLAGS = -g -Wall -DVERSION=\"$(FG_VERSION)\"
 # on your environment:
 #---------------------------------------------------------------------------
 
+#---------------------------------------------------------------------------
+# Linux/Mesa with the GLUT toolkit
+#
+INTERFACE_FLAGS = -DGLUT
+INTERFACE_LIBS = -lglut
+INTERFACE_FILES = GLUTmain.c GLUTkey.c
+MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
+X11_LIBS =  -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
+GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
+FG_CFLAGS = $(GLOBAL_CFLAGS)
+#---------------------------------------------------------------------------
+
 #---------------------------------------------------------------------------
 # SGI IRIX with the GLUT toolkit 
 #     (Surprisingly, this also works on our SunOS 4.x machine with the 
@@ -106,28 +118,16 @@ GLOBAL_CFLAGS = -g -Wall -DVERSION=\"$(FG_VERSION)\"
 #---------------------------------------------------------------------------
 
 #---------------------------------------------------------------------------
-# Linux/Mesa with the GLUT toolkit
+# Sun/Solaris with the GLUT toolkit
 #
+# VERSION=\"$(VERSION)\"
 # INTERFACE_FLAGS = -DGLUT
 # INTERFACE_LIBS = -lglut
 # INTERFACE_FILES = GLUTmain.c GLUTkey.c
-# MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
-# X11_LIBS =  -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
-# GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
+# GRAPHICS_LIBS =  -lGLU -lGL -lXext -lXmu -lXi -lX11
 # FG_CFLAGS = $(GLOBAL_CFLAGS)
 #---------------------------------------------------------------------------
 
-#---------------------------------------------------------------------------
-# Sun/Solaris with the GLUT toolkit
-#
-VERSION=\"$(VERSION)\"
-INTERFACE_FLAGS = -DGLUT
-INTERFACE_LIBS = -lglut
-INTERFACE_FILES = GLUTmain.c GLUTkey.c
-GRAPHICS_LIBS =  -lGLU -lGL -lXext -lXmu -lXi -lX11
-FG_CFLAGS = $(GLOBAL_CFLAGS)
-#---------------------------------------------------------------------------
-
 #---------------------------------------------------------------------------
 # Cygnus Win32 (gcc based) with a static version of the GLUT toolkit
 #
@@ -142,6 +142,9 @@ FG_CFLAGS = $(GLOBAL_CFLAGS)
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.24  1997/12/12 21:41:24  curt
+# More light/material property tweaking ... still a ways off.
+#
 # Revision 1.23  1997/12/12 19:52:32  curt
 # Solaris tweaks.
 #
index 2fbb83eed8da038a6c1231c27c6dcd69fa691b7b..87000c24113dc511c17ca3443f5356f65197e212 100644 (file)
@@ -231,9 +231,9 @@ void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t) {
     static long int warp = 0;
 
     /* get current Unix calendar time (in seconds) */
-    warp += 240;
     /* warp = 60; */
-    t->cur_time = time(NULL) + (0) * 60 * 60;
+    warp += 0;
+    t->cur_time = time(NULL) + (3) * 60 * 60;
     t->cur_time += warp;
     printf("Current Unix calendar time = %ld  warp = %ld\n", t->cur_time, warp);
 
@@ -285,9 +285,12 @@ void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t) {
 
 
 /* $Log$
-/* Revision 1.17  1997/12/12 19:53:04  curt
-/* Working on lightling and material properties.
+/* Revision 1.18  1997/12/12 21:41:31  curt
+/* More light/material property tweaking ... still a ways off.
 /*
+ * Revision 1.17  1997/12/12 19:53:04  curt
+ * Working on lightling and material properties.
+ *
  * Revision 1.16  1997/12/11 04:43:57  curt
  * Fixed sun vector and lighting problems.  I thing the moon is now lit
  * correctly.