1
0
Fork 0

Add xgl wrappers for debugging.

Generate terrain normals on the fly.
This commit is contained in:
curt 1997-12-15 23:54:25 +00:00
parent d1a5d93ca2
commit d19c5f0b6f
35 changed files with 607 additions and 403 deletions

View file

@ -27,7 +27,7 @@
#include <stdio.h> #include <stdio.h>
#include "aircraft.h" #include "aircraft.h"
#include "../constants.h" #include "../Include/constants.h"
/* This is a record containing all the info for the aircraft currently /* This is a record containing all the info for the aircraft currently
@ -53,10 +53,14 @@ void fgAircraftOutputCurrent(struct fgAIRCRAFT *a) {
/* $Log$ /* $Log$
/* Revision 1.12 1997/12/10 22:37:37 curt /* Revision 1.13 1997/12/15 23:54:30 curt
/* Prepended "fg" on the name of all global structures that didn't have it yet. /* Add xgl wrappers for debugging.
/* i.e. "struct WEATHER {}" became "struct fgWEATHER {}" /* Generate terrain normals on the fly.
/* /*
* Revision 1.12 1997/12/10 22:37:37 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.11 1997/09/13 02:00:05 curt * Revision 1.11 1997/09/13 02:00:05 curt
* Mostly working on stars and generating sidereal time for accurate star * Mostly working on stars and generating sidereal time for accurate star
* placement. * placement.

View file

@ -1,4 +1,4 @@
aircraft.o: aircraft.c aircraft.h ../Flight/flight.h \ aircraft.o: aircraft.c aircraft.h ../Flight/flight.h \
../Flight/Slew/slew.h ../Flight/LaRCsim/ls_interface.h \ ../Flight/Slew/slew.h ../Flight/LaRCsim/ls_interface.h \
../Flight/LaRCsim/../flight.h ../Controls/controls.h \ ../Flight/LaRCsim/../flight.h ../Controls/controls.h \
../Controls/../limits.h ../constants.h ../Controls/../Include/limits.h ../Include/constants.h

View file

@ -29,7 +29,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "cockpit.h" #include "cockpit.h"
#include "../constants.h" #include "../Include/constants.h"
#include "../Aircraft/aircraft.h" #include "../Aircraft/aircraft.h"
#include "../Scenery/mesh.h" #include "../Scenery/mesh.h"
@ -87,10 +87,14 @@ void fgCockpitUpdate()
/* $Log$ /* $Log$
/* Revision 1.2 1997/12/10 22:37:38 curt /* Revision 1.3 1997/12/15 23:54:33 curt
/* Prepended "fg" on the name of all global structures that didn't have it yet. /* Add xgl wrappers for debugging.
/* i.e. "struct WEATHER {}" became "struct fgWEATHER {}" /* Generate terrain normals on the fly.
/* /*
* Revision 1.2 1997/12/10 22:37:38 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.1 1997/08/29 18:03:20 curt * Revision 1.1 1997/08/29 18:03:20 curt
* Initial revision. * Initial revision.
* *

View file

@ -3,28 +3,28 @@ cockpit.o: cockpit.c cockpit.h hud.h ../Aircraft/aircraft.h \
../Aircraft/../Flight/LaRCsim/ls_interface.h \ ../Aircraft/../Flight/LaRCsim/ls_interface.h \
../Aircraft/../Flight/LaRCsim/../flight.h \ ../Aircraft/../Flight/LaRCsim/../flight.h \
../Aircraft/../Controls/controls.h \ ../Aircraft/../Controls/controls.h \
../Aircraft/../Controls/../limits.h ../Flight/flight.h \ ../Aircraft/../Controls/../Include/limits.h ../Flight/flight.h \
../Controls/controls.h ../constants.h ../Scenery/mesh.h \ ../Controls/controls.h ../Include/constants.h ../Scenery/mesh.h \
../Scenery/scenery.h ../Scenery/../types.h ../Math/mat3.h \ ../Scenery/scenery.h ../Scenery/../Include/types.h ../Math/mat3.h \
../Math/polar.h ../Math/../types.h ../Time/fg_timer.h \ ../Math/polar.h ../Math/../Include/types.h ../Time/fg_timer.h \
../Math/fg_random.h ../Weather/weather.h ../Math/fg_random.h ../Weather/weather.h
hud.o: hud.c hud.h ../Aircraft/aircraft.h \ hud.o: hud.c hud.h ../Aircraft/aircraft.h \
../Aircraft/../Flight/flight.h ../Aircraft/../Flight/Slew/slew.h \ ../Aircraft/../Flight/flight.h ../Aircraft/../Flight/Slew/slew.h \
../Aircraft/../Flight/LaRCsim/ls_interface.h \ ../Aircraft/../Flight/LaRCsim/ls_interface.h \
../Aircraft/../Flight/LaRCsim/../flight.h \ ../Aircraft/../Flight/LaRCsim/../flight.h \
../Aircraft/../Controls/controls.h \ ../Aircraft/../Controls/controls.h \
../Aircraft/../Controls/../limits.h ../Flight/flight.h \ ../Aircraft/../Controls/../Include/limits.h ../Flight/flight.h \
../Controls/controls.h ../constants.h ../Scenery/mesh.h \ ../Controls/controls.h ../Include/constants.h ../Scenery/mesh.h \
../Scenery/scenery.h ../Scenery/../types.h ../Math/mat3.h \ ../Scenery/scenery.h ../Scenery/../Include/types.h ../Math/mat3.h \
../Math/polar.h ../Math/../types.h ../Time/fg_timer.h \ ../Math/polar.h ../Math/../Include/types.h ../Time/fg_timer.h \
../Math/fg_random.h ../Weather/weather.h ../Math/fg_random.h ../Weather/weather.h
test.o: test.c test.h ../Aircraft/aircraft.h \ test.o: test.c test.h ../Aircraft/aircraft.h \
../Aircraft/../Flight/flight.h ../Aircraft/../Flight/Slew/slew.h \ ../Aircraft/../Flight/flight.h ../Aircraft/../Flight/Slew/slew.h \
../Aircraft/../Flight/LaRCsim/ls_interface.h \ ../Aircraft/../Flight/LaRCsim/ls_interface.h \
../Aircraft/../Flight/LaRCsim/../flight.h \ ../Aircraft/../Flight/LaRCsim/../flight.h \
../Aircraft/../Controls/controls.h \ ../Aircraft/../Controls/controls.h \
../Aircraft/../Controls/../limits.h ../Flight/flight.h \ ../Aircraft/../Controls/../Include/limits.h ../Flight/flight.h \
../Controls/controls.h ../constants.h ../Scenery/mesh.h \ ../Controls/controls.h ../Include/constants.h ../Scenery/mesh.h \
../Scenery/scenery.h ../Scenery/../types.h ../Math/mat3.h \ ../Scenery/scenery.h ../Scenery/../Include/types.h ../Math/mat3.h \
../Math/polar.h ../Math/../types.h ../Time/fg_timer.h \ ../Math/polar.h ../Math/../Include/types.h ../Time/fg_timer.h \
../Math/fg_random.h ../Weather/weather.h ../Math/fg_random.h ../Weather/weather.h

View file

@ -31,7 +31,7 @@
#endif /* not WIN32 */ #endif /* not WIN32 */
#include "hud.h" #include "hud.h"
#include "../constants.h" #include "../Include/constants.h"
#include "../Aircraft/aircraft.h" #include "../Aircraft/aircraft.h"
#include "../Scenery/mesh.h" #include "../Scenery/mesh.h"
@ -807,10 +807,14 @@ void fgUpdateHUD( Hptr hud )
/* $Log$ /* $Log$
/* Revision 1.5 1997/12/10 22:37:39 curt /* Revision 1.6 1997/12/15 23:54:34 curt
/* Prepended "fg" on the name of all global structures that didn't have it yet. /* Add xgl wrappers for debugging.
/* i.e. "struct WEATHER {}" became "struct fgWEATHER {}" /* Generate terrain normals on the fly.
/* /*
* Revision 1.5 1997/12/10 22:37:39 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.4 1997/09/23 00:29:32 curt * Revision 1.4 1997/09/23 00:29:32 curt
* Tweaks to get things to compile with gcc-win32. * Tweaks to get things to compile with gcc-win32.
* *

View file

@ -28,7 +28,7 @@
#define CONTROLS_H #define CONTROLS_H
#include "../limits.h" #include "../Include/limits.h"
/* Define a structure containing the control parameters */ /* Define a structure containing the control parameters */
@ -81,10 +81,14 @@ void fgThrottleSet(int engine, double pos);
/* $Log$ /* $Log$
/* Revision 1.6 1997/12/10 22:37:41 curt /* Revision 1.7 1997/12/15 23:54:36 curt
/* Prepended "fg" on the name of all global structures that didn't have it yet. /* Add xgl wrappers for debugging.
/* i.e. "struct WEATHER {}" became "struct fgWEATHER {}" /* Generate terrain normals on the fly.
/* /*
* Revision 1.6 1997/12/10 22:37:41 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/08/27 03:30:02 curt * Revision 1.5 1997/08/27 03:30:02 curt
* Changed naming scheme of basic shared structures. * Changed naming scheme of basic shared structures.
* *

View file

@ -1,5 +1,6 @@
controls.o: controls.c controls.h ../limits.h ../Aircraft/aircraft.h \ controls.o: controls.c controls.h ../Include/limits.h \
../Aircraft/../Flight/flight.h ../Aircraft/../Flight/Slew/slew.h \ ../Aircraft/aircraft.h ../Aircraft/../Flight/flight.h \
../Aircraft/../Flight/Slew/slew.h \
../Aircraft/../Flight/LaRCsim/ls_interface.h \ ../Aircraft/../Flight/LaRCsim/ls_interface.h \
../Aircraft/../Flight/LaRCsim/../flight.h \ ../Aircraft/../Flight/LaRCsim/../flight.h \
../Aircraft/../Controls/controls.h ../Aircraft/../Controls/controls.h

View file

@ -12,7 +12,7 @@ ls_interface.o: ls_interface.c ls_types.h ls_constants.h ls_generic.h \
../Slew/slew.h ../LaRCsim/ls_interface.h ../../Aircraft/aircraft.h \ ../Slew/slew.h ../LaRCsim/ls_interface.h ../../Aircraft/aircraft.h \
../../Aircraft/../Flight/flight.h \ ../../Aircraft/../Flight/flight.h \
../../Aircraft/../Controls/controls.h \ ../../Aircraft/../Controls/controls.h \
../../Aircraft/../Controls/../limits.h ../../Aircraft/../Controls/../Include/limits.h
ls_model.o: ls_model.c ls_types.h ls_model.o: ls_model.c ls_types.h
ls_step.o: ls_step.c ls_types.h ls_constants.h ls_generic.h ls_step.o: ls_step.c ls_types.h ls_constants.h ls_generic.h
ls_sync.o: ls_sync.c ls_types.h ls_sim_control.h ls_sync.o: ls_sync.c ls_types.h ls_sim_control.h

View file

@ -29,12 +29,13 @@
#endif #endif
#include <GL/glut.h> #include <GL/glut.h>
#include "../XGL/xgl.h"
#include <stdio.h> #include <stdio.h>
#include "GLUTkey.h" #include "GLUTkey.h"
#include "views.h" #include "views.h"
#include "../constants.h" #include "../Include/constants.h"
#include "../Aircraft/aircraft.h" #include "../Aircraft/aircraft.h"
#include "../Weather/weather.h" #include "../Weather/weather.h"
@ -87,7 +88,7 @@ void GLUTkey(unsigned char k, int x, int y) {
return; return;
case 90: /* Z key */ case 90: /* Z key */
w->visibility /= 1.10; w->visibility /= 1.10;
glFogf(GL_FOG_END, w->visibility); xglFogf(GL_FOG_END, w->visibility);
printf("Fog density = %.4f\n", w->visibility); printf("Fog density = %.4f\n", w->visibility);
return; return;
} }
@ -131,7 +132,7 @@ void GLUTkey(unsigned char k, int x, int y) {
return; return;
case 122: /* z key */ case 122: /* z key */
w->visibility *= 1.10; w->visibility *= 1.10;
glFogf(GL_FOG_END, w->visibility); xglFogf(GL_FOG_END, w->visibility);
printf("Fog density = %.4f\n", w->visibility); printf("Fog density = %.4f\n", w->visibility);
return; return;
case 27: /* ESC */ case 27: /* ESC */
@ -224,10 +225,14 @@ void GLUTspecialkey(int k, int x, int y) {
/* $Log$ /* $Log$
/* Revision 1.22 1997/12/10 22:37:45 curt /* Revision 1.23 1997/12/15 23:54:44 curt
/* Prepended "fg" on the name of all global structures that didn't have it yet. /* Add xgl wrappers for debugging.
/* i.e. "struct WEATHER {}" became "struct fgWEATHER {}" /* Generate terrain normals on the fly.
/* /*
* Revision 1.22 1997/12/10 22:37:45 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.21 1997/08/27 21:32:23 curt * Revision 1.21 1997/08/27 21:32:23 curt
* Restructured view calculation code. Added stars. * Restructured view calculation code. Added stars.
* *

View file

@ -29,14 +29,15 @@
#endif #endif
#include <GL/glut.h> #include <GL/glut.h>
#include "../XGL/xgl.h"
#include <stdio.h> #include <stdio.h>
#include "GLUTkey.h" #include "GLUTkey.h"
#include "fg_init.h" #include "fg_init.h"
#include "views.h" #include "views.h"
#include "../constants.h" #include "../Include/constants.h"
#include "../general.h" #include "../Include/general.h"
#include "../Aircraft/aircraft.h" #include "../Aircraft/aircraft.h"
#include "../Cockpit/cockpit.h" #include "../Cockpit/cockpit.h"
@ -87,32 +88,32 @@ static void fgInitVisuals() {
t = &cur_time_params; t = &cur_time_params;
w = &current_weather; w = &current_weather;
glEnable( GL_DEPTH_TEST ); xglEnable( GL_DEPTH_TEST );
/* glFrontFace(GL_CW); */ /* xglFrontFace(GL_CW); */
glEnable( GL_CULL_FACE ); xglEnable( GL_CULL_FACE );
/* glDisable( GL_DITHER ); */ /* xglDisable( GL_DITHER ); */
/* If enabled, normal vectors specified with glNormal are scaled /* If enabled, normal vectors specified with glNormal are scaled
to unit length after transformation. See glNormal. */ to unit length after transformation. See glNormal. */
glEnable( GL_NORMALIZE ); xglEnable( GL_NORMALIZE );
glEnable( GL_LIGHTING ); xglEnable( GL_LIGHTING );
glEnable( GL_LIGHT0 ); xglEnable( GL_LIGHT0 );
glLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec ); xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec );
glShadeModel( GL_FLAT ); /* glShadeModel( GL_SMOOTH ); */ xglShadeModel( GL_FLAT ); /* xglShadeModel( GL_SMOOTH ); */
glEnable( GL_FOG ); xglEnable( GL_FOG );
glFogi (GL_FOG_MODE, GL_LINEAR); xglFogi (GL_FOG_MODE, GL_LINEAR);
/* glFogf (GL_FOG_START, 1.0); */ /* xglFogf (GL_FOG_START, 1.0); */
glFogf (GL_FOG_END, w->visibility); xglFogf (GL_FOG_END, w->visibility);
glFogfv (GL_FOG_COLOR, fgFogColor); xglFogfv (GL_FOG_COLOR, fgFogColor);
/* glFogf (GL_FOG_DENSITY, w->visibility); */ /* xglFogf (GL_FOG_DENSITY, w->visibility); */
/* glHint (GL_FOG_HINT, GL_FASTEST); */ /* xglHint (GL_FOG_HINT, GL_FASTEST); */
/* initial screen color */ /* initial screen color */
glClearColor(0.0, 0.0, 0.0, 1.0); xglClearColor(0.0, 0.0, 0.0, 1.0);
} }
@ -141,22 +142,22 @@ static void fgUpdateViewParams() {
fgViewUpdate(f, v); fgViewUpdate(f, v);
/* Tell GL we are about to modify the projection parameters */ /* Tell GL we are about to modify the projection parameters */
glMatrixMode(GL_PROJECTION); xglMatrixMode(GL_PROJECTION);
glLoadIdentity(); xglLoadIdentity();
gluPerspective(55.0, 1.0/win_ratio, 1.0, 200000.0); gluPerspective(55.0, 1.0/win_ratio, 1.0, 200000.0);
glMatrixMode(GL_MODELVIEW); xglMatrixMode(GL_MODELVIEW);
glLoadIdentity(); xglLoadIdentity();
/* set up our view volume */ /* set up our view volume */
gluLookAt(v->view_pos.x, v->view_pos.y, v->view_pos.z, gluLookAt(v->view_pos.x, v->view_pos.y, v->view_pos.z,
v->view_pos.x + v->view_forward[0], v->view_pos.x + v->view_forward[0],
v->view_pos.y + v->view_forward[1], v->view_pos.y + v->view_forward[1],
v->view_pos.z + v->view_forward[2], v->view_pos.z + v->view_forward[2],
v->view_up[0], v->view_up[1], v->view_up[2]); v->view_up[0], v->view_up[1], v->view_up[2]);
/* set the sun position */ /* set the sun position */
glLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec ); xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec );
/* calculate lighting parameters based on sun's relative angle to /* calculate lighting parameters based on sun's relative angle to
* local up */ * local up */
@ -190,15 +191,15 @@ static void fgUpdateViewParams() {
l->scene_diffuse[2] = white[2] * diffuse; l->scene_diffuse[2] = white[2] * diffuse;
/* set lighting parameters */ /* set lighting parameters */
glLightfv(GL_LIGHT0, GL_AMBIENT, l->scene_ambient ); xglLightfv(GL_LIGHT0, GL_AMBIENT, l->scene_ambient );
glLightfv(GL_LIGHT0, GL_DIFFUSE, l->scene_diffuse ); xglLightfv(GL_LIGHT0, GL_DIFFUSE, l->scene_diffuse );
/* set fog color */ /* set fog color */
l->scene_fog[0] = fgFogColor[0] * (ambient + diffuse); l->scene_fog[0] = fgFogColor[0] * (ambient + diffuse);
l->scene_fog[1] = fgFogColor[1] * (ambient + diffuse); l->scene_fog[1] = fgFogColor[1] * (ambient + diffuse);
l->scene_fog[2] = fgFogColor[2] * (ambient + diffuse); l->scene_fog[2] = fgFogColor[2] * (ambient + diffuse);
l->scene_fog[3] = fgFogColor[3]; l->scene_fog[3] = fgFogColor[3];
glFogfv (GL_FOG_COLOR, l->scene_fog); xglFogfv (GL_FOG_COLOR, l->scene_fog);
/* set sky color */ /* set sky color */
l->scene_clear[0] = sky_color[0] * sky_brightness; l->scene_clear[0] = sky_color[0] * sky_brightness;
@ -206,8 +207,8 @@ static void fgUpdateViewParams() {
l->scene_clear[2] = sky_color[2] * sky_brightness; l->scene_clear[2] = sky_color[2] * sky_brightness;
l->scene_clear[3] = sky_color[3]; l->scene_clear[3] = sky_color[3];
glClearColor(l->scene_clear[0], l->scene_clear[1], xglClearColor(l->scene_clear[0], l->scene_clear[1],
l->scene_clear[2], l->scene_clear[3]); l->scene_clear[2], l->scene_clear[3]);
} }
@ -219,11 +220,11 @@ static void fgUpdateVisuals( void ) {
/* update view volume parameters */ /* update view volume parameters */
fgUpdateViewParams(); fgUpdateViewParams();
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); xglClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
/* Tell GL we are switching to model view parameters */ /* Tell GL we are switching to model view parameters */
glMatrixMode(GL_MODELVIEW); xglMatrixMode(GL_MODELVIEW);
/* glLoadIdentity(); */ /* xglLoadIdentity(); */
/* draw scenery */ /* draw scenery */
fgSceneryRender(); fgSceneryRender();
@ -236,7 +237,7 @@ static void fgUpdateVisuals( void ) {
fgCockpitUpdate(); fgCockpitUpdate();
#ifdef GLUT #ifdef GLUT
glutSwapBuffers(); xglutSwapBuffers();
#endif #endif
} }
@ -335,38 +336,38 @@ void fgInitTimeDepCalcs() {
int num_lines = 16; int num_lines = 16;
float line_len, line_width_2, cur_pos; float line_len, line_width_2, cur_pos;
runway = glGenLists(1); runway = xglGenLists(1);
glNewList(runway, GL_COMPILE); xglNewList(runway, GL_COMPILE);
*/ */
/* draw concrete */ /* draw concrete */
/* glBegin(GL_POLYGON); /* xglBegin(GL_POLYGON);
glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, concrete ); xglMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, concrete );
glNormal3f(0.0, 0.0, 1.0); xglNormal3f(0.0, 0.0, 1.0);
glVertex3d( 0.0, -width/2.0, 0.0); xglVertex3d( 0.0, -width/2.0, 0.0);
glVertex3d( 0.0, width/2.0, 0.0); xglVertex3d( 0.0, width/2.0, 0.0);
glVertex3d(length, width/2.0, 0.0); xglVertex3d(length, width/2.0, 0.0);
glVertex3d(length, -width/2.0, 0.0); xglVertex3d(length, -width/2.0, 0.0);
glEnd(); xglEnd();
*/ */
/* draw center line */ /* draw center line */
/* glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, line ); /* xglMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, line );
line_len = length / ( 2 * num_lines + 1); line_len = length / ( 2 * num_lines + 1);
printf("line_len = %.3f\n", line_len); printf("line_len = %.3f\n", line_len);
line_width_2 = 0.02; line_width_2 = 0.02;
cur_pos = line_len; cur_pos = line_len;
for ( i = 0; i < num_lines; i++ ) { for ( i = 0; i < num_lines; i++ ) {
glBegin(GL_POLYGON); xglBegin(GL_POLYGON);
glVertex3d( cur_pos, -line_width_2, 0.005); xglVertex3d( cur_pos, -line_width_2, 0.005);
glVertex3d( cur_pos, line_width_2, 0.005); xglVertex3d( cur_pos, line_width_2, 0.005);
cur_pos += line_len; cur_pos += line_len;
glVertex3d( cur_pos, line_width_2, 0.005); xglVertex3d( cur_pos, line_width_2, 0.005);
glVertex3d( cur_pos, -line_width_2, 0.005); xglVertex3d( cur_pos, -line_width_2, 0.005);
cur_pos += line_len; cur_pos += line_len;
glEnd(); xglEnd();
} }
glEndList(); xglEndList();
return(runway); return(runway);
} }
@ -376,17 +377,17 @@ void fgInitTimeDepCalcs() {
/*static void fgSceneryDraw_OLD() { /*static void fgSceneryDraw_OLD() {
static float z = 32.35; static float z = 32.35;
glPushMatrix(); xglPushMatrix();
glCallList(scenery); xglCallList(scenery);
printf("*** Drawing runway at %.2f\n", z); printf("*** Drawing runway at %.2f\n", z);
glTranslatef( -398391.28, 120070.41, 32.35); xglTranslatef( -398391.28, 120070.41, 32.35);
glRotatef(170.0, 0.0, 0.0, 1.0); xglRotatef(170.0, 0.0, 0.0, 1.0);
glCallList(runway); xglCallList(runway);
glPopMatrix(); xglPopMatrix();
} }
*/ */
@ -475,11 +476,11 @@ static void fgReshape( int width, int height ) {
} }
/* Inform gl of our view window size */ /* Inform gl of our view window size */
glViewport(0, 0, (GLint)width, (GLint)height); xglViewport(0, 0, (GLint)width, (GLint)height);
fgUpdateViewParams(); fgUpdateViewParams();
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); xglClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
} }
@ -500,16 +501,16 @@ int main( int argc, char *argv[] ) {
#ifdef GLUT #ifdef GLUT
/* initialize GLUT */ /* initialize GLUT */
glutInit(&argc, argv); xglutInit(&argc, argv);
/* Define Display Parameters */ /* Define Display Parameters */
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE ); xglutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
/* Define initial window size */ /* Define initial window size */
glutInitWindowSize(640, 480); xglutInitWindowSize(640, 480);
/* Initialize windows */ /* Initialize windows */
glutCreateWindow("Flight Gear"); xglutCreateWindow("Flight Gear");
#endif #endif
/* This is the general house keeping init routine */ /* This is the general house keeping init routine */
@ -536,17 +537,17 @@ int main( int argc, char *argv[] ) {
#ifdef GLUT #ifdef GLUT
/* call fgReshape() on window resizes */ /* call fgReshape() on window resizes */
glutReshapeFunc( fgReshape ); xglutReshapeFunc( fgReshape );
/* call key() on keyboard event */ /* call key() on keyboard event */
glutKeyboardFunc( GLUTkey ); xglutKeyboardFunc( GLUTkey );
glutSpecialFunc( GLUTspecialkey ); glutSpecialFunc( GLUTspecialkey );
/* call fgMainLoop() whenever there is nothing else to do */ /* call fgMainLoop() whenever there is nothing else to do */
glutIdleFunc( fgMainLoop ); xglutIdleFunc( fgMainLoop );
/* draw the scene */ /* draw the scene */
glutDisplayFunc( fgUpdateVisuals ); xglutDisplayFunc( fgUpdateVisuals );
/* pass control off to the GLUT event handler */ /* pass control off to the GLUT event handler */
glutMainLoop(); glutMainLoop();
@ -564,9 +565,13 @@ int main( int argc, char *argv[] ) {
/* $Log$ /* $Log$
/* Revision 1.32 1997/12/15 20:59:08 curt /* Revision 1.33 1997/12/15 23:54:45 curt
/* Misc. tweaks. /* Add xgl wrappers for debugging.
/* Generate terrain normals on the fly.
/* /*
* Revision 1.32 1997/12/15 20:59:08 curt
* Misc. tweaks.
*
* Revision 1.31 1997/12/12 21:41:25 curt * Revision 1.31 1997/12/12 21:41:25 curt
* More light/material property tweaking ... still a ways off. * More light/material property tweaking ... still a ways off.
* *

View file

@ -30,14 +30,14 @@ AFILES = ../Aircraft/libAircraft.a ../Cockpit/libCockpit.a \
../Controls/libControls.a ../Flight/libFlight.a \ ../Controls/libControls.a ../Flight/libFlight.a \
../Joystick/libJoystick.a ../Flight/LaRCsim/libLaRCsim.a \ ../Joystick/libJoystick.a ../Flight/LaRCsim/libLaRCsim.a \
../Flight/Slew/libSlew.a ../Scenery/libScenery.a \ ../Flight/Slew/libSlew.a ../Scenery/libScenery.a \
../Time/libTime.a ../Weather/libWeather.a ../Math/libMath.a ../Time/libTime.a ../Weather/libWeather.a ../Math/libMath.a \
include ../make.inc include ../make.inc
CFLAGS = $(FG_CFLAGS) $(INTERFACE_FLAGS) CFLAGS = $(FG_CFLAGS) $(INTERFACE_FLAGS)
LIBS = $(INTERFACE_LIBS) $(GRAPHICS_LIBS) -lm -lfl LIBS = $(FG_DEBUG_LIBS) $(INTERFACE_LIBS) $(GRAPHICS_LIBS) -lm -lfl
TARGET=fg-$(FG_VERSION) TARGET=fg-$(FG_VERSION)
@ -83,6 +83,10 @@ views.o:
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# $Log$ # $Log$
# Revision 1.38 1997/12/15 23:54:47 curt
# Add xgl wrappers for debugging.
# Generate terrain normals on the fly.
#
# Revision 1.37 1997/12/12 21:41:26 curt # Revision 1.37 1997/12/12 21:41:26 curt
# More light/material property tweaking ... still a ways off. # More light/material property tweaking ... still a ways off.
# #

View file

@ -1,36 +1,39 @@
GLUTkey.o: GLUTkey.c GLUTkey.h views.h ../types.h ../Flight/flight.h \ GLUTkey.o: GLUTkey.c GLUTkey.h views.h ../Include/types.h \
../Flight/Slew/slew.h ../Flight/LaRCsim/ls_interface.h \
../Flight/LaRCsim/../flight.h ../Math/mat3.h ../constants.h \
../Aircraft/aircraft.h ../Aircraft/../Flight/flight.h \
../Aircraft/../Controls/controls.h \
../Aircraft/../Controls/../limits.h ../Weather/weather.h
GLUTmain.o: GLUTmain.c GLUTkey.h fg_init.h views.h ../types.h \
../Flight/flight.h ../Flight/Slew/slew.h \ ../Flight/flight.h ../Flight/Slew/slew.h \
../Flight/LaRCsim/ls_interface.h ../Flight/LaRCsim/../flight.h \ ../Flight/LaRCsim/ls_interface.h ../Flight/LaRCsim/../flight.h \
../Math/mat3.h ../constants.h ../general.h ../Aircraft/aircraft.h \ ../Math/mat3.h ../Include/constants.h ../Aircraft/aircraft.h \
../Aircraft/../Flight/flight.h ../Aircraft/../Controls/controls.h \ ../Aircraft/../Flight/flight.h ../Aircraft/../Controls/controls.h \
../Aircraft/../Controls/../limits.h ../Cockpit/cockpit.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 \
../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 \
../Aircraft/../Controls/controls.h \
../Aircraft/../Controls/../Include/limits.h ../Cockpit/cockpit.h \
../Cockpit/hud.h ../Cockpit/../Aircraft/aircraft.h \ ../Cockpit/hud.h ../Cockpit/../Aircraft/aircraft.h \
../Cockpit/../Flight/flight.h ../Cockpit/../Controls/controls.h \ ../Cockpit/../Flight/flight.h ../Cockpit/../Controls/controls.h \
../Joystick/joystick.h ../Math/fg_geodesy.h ../Math/polar.h \ ../Joystick/joystick.h ../Math/fg_geodesy.h ../Math/polar.h \
../Math/../types.h ../Scenery/mesh.h ../Scenery/scenery.h \ ../Math/../Include/types.h ../Scenery/mesh.h ../Scenery/scenery.h \
../Scenery/../types.h ../Time/fg_time.h ../Time/../types.h \ ../Scenery/../Include/types.h ../Time/fg_time.h \
../Time/../Flight/flight.h ../Time/fg_timer.h ../Time/sunpos.h \ ../Time/../Include/types.h ../Time/../Flight/flight.h \
../Weather/weather.h ../Time/fg_timer.h ../Time/sunpos.h ../Weather/weather.h
fg_init.o: fg_init.c fg_init.h views.h ../types.h ../Flight/flight.h \ fg_init.o: fg_init.c fg_init.h views.h ../Include/types.h \
../Flight/Slew/slew.h ../Flight/LaRCsim/ls_interface.h \ ../Flight/flight.h ../Flight/Slew/slew.h \
../Flight/LaRCsim/../flight.h ../Math/mat3.h ../constants.h \ ../Flight/LaRCsim/ls_interface.h ../Flight/LaRCsim/../flight.h \
../general.h ../Aircraft/aircraft.h ../Aircraft/../Flight/flight.h \ ../Math/mat3.h ../Include/constants.h ../Include/general.h \
../Aircraft/aircraft.h ../Aircraft/../Flight/flight.h \
../Aircraft/../Controls/controls.h \ ../Aircraft/../Controls/controls.h \
../Aircraft/../Controls/../limits.h ../Cockpit/cockpit.h \ ../Aircraft/../Controls/../Include/limits.h ../Cockpit/cockpit.h \
../Cockpit/hud.h ../Cockpit/../Aircraft/aircraft.h \ ../Cockpit/hud.h ../Cockpit/../Aircraft/aircraft.h \
../Cockpit/../Flight/flight.h ../Cockpit/../Controls/controls.h \ ../Cockpit/../Flight/flight.h ../Cockpit/../Controls/controls.h \
../Joystick/joystick.h ../Math/fg_random.h ../Scenery/mesh.h \ ../Joystick/joystick.h ../Math/fg_random.h ../Scenery/mesh.h \
../Scenery/astro.h ../Scenery/stars.h ../Scenery/scenery.h \ ../Scenery/astro.h ../Scenery/stars.h ../Scenery/scenery.h \
../Scenery/../types.h ../Time/fg_time.h ../Time/../types.h \ ../Scenery/../Include/types.h ../Time/fg_time.h \
../Time/../Flight/flight.h ../Time/sunpos.h ../Weather/weather.h ../Time/../Include/types.h ../Time/../Flight/flight.h \
views.o: views.c views.h ../types.h ../Flight/flight.h \ ../Time/sunpos.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/Slew/slew.h ../Flight/LaRCsim/ls_interface.h \
../Flight/LaRCsim/../flight.h ../Math/mat3.h ../constants.h \ ../Flight/LaRCsim/../flight.h ../Math/mat3.h ../Include/constants.h \
../Math/polar.h ../Math/../types.h ../Scenery/scenery.h \ ../Math/polar.h ../Math/../Include/types.h ../Scenery/scenery.h \
../Scenery/../types.h ../Scenery/../Include/types.h

View file

@ -30,8 +30,8 @@
#include "fg_init.h" #include "fg_init.h"
#include "views.h" #include "views.h"
#include "../constants.h" #include "../Include/constants.h"
#include "../general.h" #include "../Include/general.h"
#include "../Aircraft/aircraft.h" #include "../Aircraft/aircraft.h"
#include "../Cockpit/cockpit.h" #include "../Cockpit/cockpit.h"
@ -218,9 +218,13 @@ void fgInitSubsystems( void ) {
/* $Log$ /* $Log$
/* Revision 1.17 1997/12/15 20:59:09 curt /* Revision 1.18 1997/12/15 23:54:49 curt
/* Misc. tweaks. /* Add xgl wrappers for debugging.
/* Generate terrain normals on the fly.
/* /*
* Revision 1.17 1997/12/15 20:59:09 curt
* Misc. tweaks.
*
* Revision 1.16 1997/12/12 19:52:48 curt * Revision 1.16 1997/12/12 19:52:48 curt
* Working on lightling and material properties. * Working on lightling and material properties.
* *

View file

@ -26,7 +26,7 @@
#include "views.h" #include "views.h"
#include "../constants.h" #include "../Include/constants.h"
#include "../Flight/flight.h" #include "../Flight/flight.h"
#include "../Math/mat3.h" #include "../Math/mat3.h"
@ -133,10 +133,14 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v) {
/* $Log$ /* $Log$
/* Revision 1.2 1997/12/10 22:37:48 curt /* Revision 1.3 1997/12/15 23:54:50 curt
/* Prepended "fg" on the name of all global structures that didn't have it yet. /* Add xgl wrappers for debugging.
/* i.e. "struct WEATHER {}" became "struct fgWEATHER {}" /* 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 {}"
*
* Revision 1.1 1997/08/27 21:31:17 curt * Revision 1.1 1997/08/27 21:31:17 curt
* Initial revision. * Initial revision.
* *

View file

@ -28,7 +28,7 @@
#define VIEWS_H #define VIEWS_H
#include "../types.h" #include "../Include/types.h"
#include "../Flight/flight.h" #include "../Flight/flight.h"
#include "../Math/mat3.h" #include "../Math/mat3.h"
@ -55,10 +55,14 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v);
/* $Log$ /* $Log$
/* Revision 1.2 1997/12/10 22:37:48 curt /* Revision 1.3 1997/12/15 23:54:51 curt
/* Prepended "fg" on the name of all global structures that didn't have it yet. /* Add xgl wrappers for debugging.
/* i.e. "struct WEATHER {}" became "struct fgWEATHER {}" /* 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 {}"
*
* Revision 1.1 1997/08/27 21:31:18 curt * Revision 1.1 1997/08/27 21:31:18 curt
* Initial revision. * Initial revision.
* *

View file

@ -29,6 +29,7 @@
#include <time.h> #include <time.h>
#include <GL/glut.h> #include <GL/glut.h>
#include "../XGL/xgl.h"
#include "astro.h" #include "astro.h"
#include "moon.h" #include "moon.h"
@ -37,8 +38,8 @@
#include "stars.h" #include "stars.h"
#include "sun.h" #include "sun.h"
#include "../constants.h" #include "../Include/constants.h"
#include "../general.h" #include "../Include/general.h"
#include "../Main/views.h" #include "../Main/views.h"
#include "../Aircraft/aircraft.h" #include "../Aircraft/aircraft.h"
@ -87,22 +88,22 @@ void fgAstroRender() {
} }
/* Disable fog effects */ /* Disable fog effects */
glDisable( GL_FOG ); xglDisable( GL_FOG );
/* set the sun position */ /* set the sun position */
glLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec_inv ); xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec_inv );
glPushMatrix(); xglPushMatrix();
/* Translate to view position */ /* Translate to view position */
glTranslatef( v->view_pos.x, v->view_pos.y, v->view_pos.z ); xglTranslatef( v->view_pos.x, v->view_pos.y, v->view_pos.z );
/* Rotate based on gst (side real time) */ /* Rotate based on gst (side real time) */
angle = t->gst * 15.041085; /* should be 15.041085, Curt thought it was 15*/ angle = t->gst * 15.041085; /* should be 15.041085, Curt thought it was 15*/
#ifdef DEBUG #ifdef DEBUG
printf("Rotating astro objects by %.2f degrees\n",angle); printf("Rotating astro objects by %.2f degrees\n",angle);
#endif #endif
glRotatef( angle, 0.0, 0.0, -1.0 ); xglRotatef( angle, 0.0, 0.0, -1.0 );
/* render the moon */ /* render the moon */
fgMoonRender(); fgMoonRender();
@ -113,17 +114,21 @@ void fgAstroRender() {
/* render the sun */ /* render the sun */
fgSunRender(); fgSunRender();
glPopMatrix(); xglPopMatrix();
/* reenable fog effects */ /* reenable fog effects */
glEnable( GL_FOG ); xglEnable( GL_FOG );
} }
/* $Log$ /* $Log$
/* Revision 1.7 1997/12/15 20:59:09 curt /* Revision 1.8 1997/12/15 23:54:57 curt
/* Misc. tweaks. /* Add xgl wrappers for debugging.
/* Generate terrain normals on the fly.
/* /*
* Revision 1.7 1997/12/15 20:59:09 curt
* Misc. tweaks.
*
* Revision 1.6 1997/12/12 21:41:27 curt * Revision 1.6 1997/12/12 21:41:27 curt
* More light/material property tweaking ... still a ways off. * More light/material property tweaking ... still a ways off.
* *

View file

@ -1,46 +1,48 @@
astro.o: astro.c astro.h stars.h moon.h orbits.h ../Time/fg_time.h \ astro.o: astro.c astro.h stars.h moon.h orbits.h ../Time/fg_time.h \
../Time/../types.h ../Time/../Flight/flight.h \ ../Time/../Include/types.h ../Time/../Flight/flight.h \
../Time/../Flight/Slew/slew.h \ ../Time/../Flight/Slew/slew.h \
../Time/../Flight/LaRCsim/ls_interface.h \ ../Time/../Flight/LaRCsim/ls_interface.h \
../Time/../Flight/LaRCsim/../flight.h planets.h sun.h ../constants.h \ ../Time/../Flight/LaRCsim/../flight.h planets.h sun.h \
../general.h ../Main/views.h ../Main/../types.h \ ../Include/constants.h ../Include/general.h ../Main/views.h \
../Main/../Flight/flight.h ../Main/../Math/mat3.h \ ../Main/../Include/types.h ../Main/../Flight/flight.h \
../Aircraft/aircraft.h ../Aircraft/../Flight/flight.h \ ../Main/../Math/mat3.h ../Aircraft/aircraft.h \
../Aircraft/../Controls/controls.h \ ../Aircraft/../Flight/flight.h ../Aircraft/../Controls/controls.h \
../Aircraft/../Controls/../limits.h ../Aircraft/../Controls/../Include/limits.h
common.o: common.c common.h common.o: common.c common.h
geometry.o: geometry.c geometry.h mesh.h geometry.o: geometry.c geometry.h mesh.h
mesh.o: mesh.c ../constants.h ../types.h ../Math/fg_geodesy.h \ mesh.o: mesh.c ../Include/constants.h ../Include/types.h \
../Math/fg_random.h ../Math/mat3.h ../Math/polar.h ../Math/../types.h \ ../Math/fg_geodesy.h ../Math/fg_random.h ../Math/mat3.h \
mesh.h common.h scenery.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/../types.h \ moon.o: moon.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/ls_interface.h \
../Time/../Flight/LaRCsim/../flight.h moon.h ../general.h \ ../Time/../Flight/LaRCsim/../flight.h moon.h ../Include/general.h \
../Main/views.h ../Main/../types.h ../Main/../Flight/flight.h \ ../Main/views.h ../Main/../Include/types.h ../Main/../Flight/flight.h \
../Main/../Math/mat3.h ../Main/../Math/mat3.h
obj.o: obj.c obj.h scenery.h ../types.h ../Math/mat3.h obj.o: obj.c obj.h scenery.h ../Include/types.h ../Math/mat3.h
orbits.o: orbits.c orbits.h ../Time/fg_time.h ../Time/../types.h \ orbits.o: orbits.c orbits.h ../Time/fg_time.h \
../Time/../Flight/flight.h ../Time/../Flight/Slew/slew.h \ ../Time/../Include/types.h ../Time/../Flight/flight.h \
../Time/../Flight/Slew/slew.h \
../Time/../Flight/LaRCsim/ls_interface.h \ ../Time/../Flight/LaRCsim/ls_interface.h \
../Time/../Flight/LaRCsim/../flight.h ../general.h ../Time/../Flight/LaRCsim/../flight.h ../Include/general.h
planets.o: planets.c ../Time/fg_time.h ../Time/../types.h \ planets.o: planets.c ../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/ls_interface.h \
../Time/../Flight/LaRCsim/../flight.h orbits.h planets.h sun.h ../Time/../Flight/LaRCsim/../flight.h orbits.h planets.h sun.h
scenery.o: scenery.c ../general.h astro.h stars.h obj.h scenery.h \ scenery.o: scenery.c ../Include/general.h astro.h stars.h obj.h \
../types.h scenery.h ../Include/types.h
stars.o: stars.c orbits.h ../Time/fg_time.h ../Time/../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 \ ../Time/../Flight/flight.h ../Time/../Flight/Slew/slew.h \
../Time/../Flight/LaRCsim/ls_interface.h \ ../Time/../Flight/LaRCsim/ls_interface.h \
../Time/../Flight/LaRCsim/../flight.h planets.h stars.h \ ../Time/../Flight/LaRCsim/../flight.h planets.h stars.h \
../constants.h ../general.h ../Aircraft/aircraft.h \ ../Include/constants.h ../Include/general.h ../Aircraft/aircraft.h \
../Aircraft/../Flight/flight.h ../Aircraft/../Controls/controls.h \ ../Aircraft/../Flight/flight.h ../Aircraft/../Controls/controls.h \
../Aircraft/../Controls/../limits.h ../Main/views.h \ ../Aircraft/../Controls/../Include/limits.h ../Main/views.h \
../Main/../types.h ../Main/../Flight/flight.h ../Main/../Math/mat3.h ../Main/../Include/types.h ../Main/../Flight/flight.h \
sun.o: sun.c ../Time/fg_time.h ../Time/../types.h \ ../Main/../Math/mat3.h
sun.o: sun.c ../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/ls_interface.h \
../Time/../Flight/LaRCsim/../flight.h ../Main/views.h \ ../Time/../Flight/LaRCsim/../flight.h ../Main/views.h \
../Main/../types.h ../Main/../Flight/flight.h ../Main/../Math/mat3.h \ ../Main/../Include/types.h ../Main/../Flight/flight.h \
orbits.h sun.h ../Main/../Math/mat3.h orbits.h sun.h

View file

@ -38,8 +38,8 @@
#include <GL/glut.h> #include <GL/glut.h>
#include "../constants.h" #include "../Include/constants.h"
#include "../types.h" #include "../Include/types.h"
#include "../Math/fg_geodesy.h" #include "../Math/fg_geodesy.h"
#include "../Math/fg_random.h" #include "../Math/fg_random.h"
#include "../Math/mat3.h" #include "../Math/mat3.h"
@ -396,9 +396,13 @@ GLint mesh_to_OpenGL(struct MESH *m) {
/* $Log$ /* $Log$
/* Revision 1.23 1997/10/30 12:38:44 curt /* Revision 1.24 1997/12/15 23:54:59 curt
/* Working on new scenery subsystem. /* Add xgl wrappers for debugging.
/* Generate terrain normals on the fly.
/* /*
* Revision 1.23 1997/10/30 12:38:44 curt
* Working on new scenery subsystem.
*
* Revision 1.22 1997/10/28 21:00:21 curt * Revision 1.22 1997/10/28 21:00:21 curt
* Changing to new terrain format. * Changing to new terrain format.
* *

View file

@ -23,11 +23,12 @@
#include <math.h> #include <math.h>
#include <GL/glut.h> #include <GL/glut.h>
#include "../XGL/xgl.h"
#include "orbits.h" #include "orbits.h"
#include "moon.h" #include "moon.h"
#include "../general.h" #include "../Include/general.h"
#include "../Main/views.h" #include "../Main/views.h"
#include "../Time/fg_time.h" #include "../Time/fg_time.h"
@ -72,15 +73,15 @@ void NormalizeVector(float v[3])
void drawTriangle(float *v1, float *v2, float *v3) void drawTriangle(float *v1, float *v2, float *v3)
{ {
glBegin(GL_POLYGON); xglBegin(GL_POLYGON);
//glBegin(GL_POINTS); //xglBegin(GL_POINTS);
glNormal3fv(v1); xglNormal3fv(v1);
glVertex3fv(v1); xglVertex3fv(v1);
glNormal3fv(v2); xglNormal3fv(v2);
glVertex3fv(v2); xglVertex3fv(v2);
glNormal3fv(v3); xglNormal3fv(v3);
glVertex3fv(v3); xglVertex3fv(v3);
glEnd(); xglEnd();
} }
void subdivide(float *v1, float *v2, float *v3, long depth) void subdivide(float *v1, float *v2, float *v3, long depth)
@ -112,17 +113,17 @@ void subdivide(float *v1, float *v2, float *v3, long depth)
void display(void) void display(void)
{ {
int i; int i;
glClear(GL_COLOR_BUFFER_BIT); xglClear(GL_COLOR_BUFFER_BIT);
glPushMatrix(); xglPushMatrix();
glRotatef(spin, 0.0, 0.0, 0.0); xglRotatef(spin, 0.0, 0.0, 0.0);
glColor3f(1.0, 1.0, 0.0); xglColor3f(1.0, 1.0, 0.0);
// glBegin(GL_LINE_LOOP); // xglBegin(GL_LINE_LOOP);
for (i = 0; i < 20; i++) for (i = 0; i < 20; i++)
{ {
//glVertex3fv(&vdata[tindices[i][0]][0]); //xglVertex3fv(&vdata[tindices[i][0]][0]);
//glVertex3fv(&vdata[tindices[i][1]][0]); //xglVertex3fv(&vdata[tindices[i][1]][0]);
//glVertex3fv(&vdata[tindices[i][2]][0]); //xglVertex3fv(&vdata[tindices[i][2]][0]);
subdivide(&vdata[tindices[i][0]][0], subdivide(&vdata[tindices[i][0]][0],
&vdata[tindices[i][1]][0], &vdata[tindices[i][1]][0],
@ -130,9 +131,9 @@ void display(void)
} }
// glEnd(); // xglEnd();
// glFlush(); // xglFlush();
glPopMatrix(); xglPopMatrix();
glutSwapBuffers(); glutSwapBuffers();
} */ } */
@ -230,11 +231,11 @@ void fgMoonInit() {
l = &cur_light_params; l = &cur_light_params;
moon = glGenLists(1); moon = xglGenLists(1);
glNewList(moon, GL_COMPILE ); xglNewList(moon, GL_COMPILE );
/* glMaterialfv(GL_FRONT, GL_AMBIENT, l->scene_clear); /* xglMaterialfv(GL_FRONT, GL_AMBIENT, l->scene_clear);
glMaterialfv(GL_FRONT, GL_DIFFUSE, moon_color); */ xglMaterialfv(GL_FRONT, GL_DIFFUSE, moon_color); */
fgSolarSystemUpdate(&(pltOrbElements[1]), cur_time_params); fgSolarSystemUpdate(&(pltOrbElements[1]), cur_time_params);
moonPos = fgCalculateMoon(pltOrbElements[1], pltOrbElements[0], moonPos = fgCalculateMoon(pltOrbElements[1], pltOrbElements[0],
@ -254,7 +255,7 @@ void fgMoonInit() {
glutSolidSphere(1.0, 15, 15); glutSolidSphere(1.0, 15, 15);
glEndList(); xglEndList();
} }
@ -267,21 +268,21 @@ void fgMoonRender() {
l = &cur_light_params; l = &cur_light_params;
/* set lighting parameters */ /* set lighting parameters */
glLightfv(GL_LIGHT0, GL_AMBIENT, l->scene_clear ); xglLightfv(GL_LIGHT0, GL_AMBIENT, l->scene_clear );
glLightfv(GL_LIGHT0, GL_DIFFUSE, moon_color ); xglLightfv(GL_LIGHT0, GL_DIFFUSE, moon_color );
glMaterialfv(GL_FRONT, GL_AMBIENT, l->scene_clear ); xglMaterialfv(GL_FRONT, GL_AMBIENT, l->scene_clear );
glMaterialfv(GL_FRONT, GL_AMBIENT, moon_color ); xglMaterialfv(GL_FRONT, GL_AMBIENT, moon_color );
glMaterialfv(GL_FRONT, GL_DIFFUSE, moon_color); xglMaterialfv(GL_FRONT, GL_DIFFUSE, moon_color);
glPushMatrix(); xglPushMatrix();
glTranslatef(xMoon, yMoon, zMoon); xglTranslatef(xMoon, yMoon, zMoon);
glScalef(1400, 1400, 1400); xglScalef(1400, 1400, 1400);
glColor3fv(moon_color); xglColor3fv(moon_color);
/* glutSolidSphere(1.0, 25, 25); */ /* glutSolidSphere(1.0, 25, 25); */
glCallList(moon); xglCallList(moon);
glPopMatrix(); xglPopMatrix();
} }

View file

@ -31,6 +31,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <GL/glut.h> #include <GL/glut.h>
#include "../XGL/xgl.h"
#include "obj.h" #include "obj.h"
#include "scenery.h" #include "scenery.h"
@ -45,23 +46,40 @@ float nodes[MAXNODES][3];
float normals[MAXNODES][3]; float normals[MAXNODES][3];
/* given three points defining a triangle, calculate the normal */
void calc_normal(float p1[3], float p2[3], float p3[3], double normal[3])
{
double v1[3], v2[3];
float temp;
v1[0] = p2[0] - p1[0]; v1[1] = p2[1] - p1[1]; v1[2] = p2[2] - p1[2];
v2[0] = p3[0] - p1[0]; v2[1] = p3[1] - p1[1]; v2[2] = p3[2] - p1[2];
MAT3cross_product(normal, v1, v2);
MAT3_NORMALIZE_VEC(normal,temp);
printf(" Normal = %.2f %.2f %.2f\n", normal[0], normal[1], normal[2]);
}
/* Load a .obj file and generate the GL call list */ /* Load a .obj file and generate the GL call list */
GLint fgObjLoad(char *path) { GLint fgObjLoad(char *path) {
char line[256], winding[256]; char line[256], winding_str[256];
double v1[3], v2[3], approx_normal[3], dot_prod, temp; double v1[3], v2[3], approx_normal[3], dot_prod, temp;
struct fgCartesianPoint ref; struct fgCartesianPoint ref;
GLint area; GLint area;
FILE *f; FILE *f;
int first, ncount, vncount, n1, n2, n3, n4; int first, ncount, vncount, n1, n2, n3, n4;
int i; int i, winding;
int last1, last2, odd;
if ( (f = fopen(path, "r")) == NULL ) { if ( (f = fopen(path, "r")) == NULL ) {
printf("Cannot open file: %s\n", path); printf("Cannot open file: %s\n", path);
exit(-1); exit(-1);
} }
area = glGenLists(1); area = xglGenLists(1);
glNewList(area, GL_COMPILE); xglNewList(area, GL_COMPILE);
first = 1; first = 1;
ncount = 1; ncount = 1;
@ -101,17 +119,19 @@ GLint fgObjLoad(char *path) {
exit(-1); exit(-1);
} }
} else if ( strncmp(line, "winding ", 8) == 0 ) { } else if ( strncmp(line, "winding ", 8) == 0 ) {
sscanf(line+8, "%s", winding); sscanf(line+8, "%s", winding_str);
printf("WINDING = %s\n", winding); printf("WINDING = %s\n", winding_str);
/* can't call glFrontFace() between glBegin() & glEnd() */ /* can't call xglFrontFace() between xglBegin() & xglEnd() */
glEnd(); xglEnd();
first = 1; first = 1;
if ( strcmp(winding, "cw") == 0 ) { if ( strcmp(winding_str, "cw") == 0 ) {
glFrontFace( GL_CW ); xglFrontFace( GL_CW );
winding = 0;
} else { } else {
glFrontFace ( GL_CCW ); xglFrontFace ( GL_CCW );
winding = 1;
} }
} else if ( line[0] == 't' ) { } else if ( line[0] == 't' ) {
/* start a new triangle strip */ /* start a new triangle strip */
@ -120,12 +140,12 @@ GLint fgObjLoad(char *path) {
if ( !first ) { if ( !first ) {
/* close out the previous structure and start the next */ /* close out the previous structure and start the next */
glEnd(); xglEnd();
} else { } else {
first = 0; first = 0;
} }
/* printf("new tri strip = %s", line); */ printf("new tri strip = %s", line);
sscanf(line, "t %d %d %d %d\n", &n1, &n2, &n3, &n4); sscanf(line, "t %d %d %d %d\n", &n1, &n2, &n3, &n4);
/* printf("(t) = "); */ /* printf("(t) = "); */
@ -133,7 +153,7 @@ GLint fgObjLoad(char *path) {
/* try to get the proper rotation by calculating an /* try to get the proper rotation by calculating an
* approximate normal and seeing if it is close to the * approximate normal and seeing if it is close to the
* precalculated normal */ * precalculated normal */
/*v1[0] = nodes[n2][0] - nodes[n1][0]; /* v1[0] = nodes[n2][0] - nodes[n1][0];
v1[1] = nodes[n2][1] - nodes[n1][1]; v1[1] = nodes[n2][1] - nodes[n1][1];
v1[2] = nodes[n2][2] - nodes[n1][2]; v1[2] = nodes[n2][2] - nodes[n1][2];
v2[0] = nodes[n3][0] - nodes[n1][0]; v2[0] = nodes[n3][0] - nodes[n1][0];
@ -149,56 +169,87 @@ GLint fgObjLoad(char *path) {
/* printf("Normal ANGLE = %.3f rads.\n", angle); */ /* printf("Normal ANGLE = %.3f rads.\n", angle); */
/* if ( dot_prod < -0.5 ) { /* if ( dot_prod < -0.5 ) {
glFrontFace( GL_CW ); xglFrontFace( GL_CW );
} else { } else {
glFrontFace( GL_CCW ); xglFrontFace( GL_CCW );
} */ } */
glBegin(GL_TRIANGLE_STRIP); xglBegin(GL_TRIANGLE_STRIP);
glNormal3d(normals[n1][0], normals[n1][1], normals[n1][2]); if ( winding ) {
glVertex3d(nodes[n1][0] - ref.x, nodes[n1][1] - ref.y, odd = 1;
nodes[n1][2] - ref.z); } else {
odd = 0;
}
glNormal3d(normals[n2][0], normals[n2][1], normals[n2][2]); if ( odd ) {
glVertex3d(nodes[n2][0] - ref.x, nodes[n2][1] - ref.y, calc_normal(nodes[n1], nodes[n2], nodes[n3], approx_normal);
nodes[n2][2] - ref.z); } else {
calc_normal(nodes[n2], nodes[n1], nodes[n3], approx_normal);
}
xglNormal3dv(approx_normal);
glNormal3d(normals[n3][0], normals[n3][1], normals[n3][2]); /* xglNormal3d(normals[n1][0], normals[n1][1], normals[n1][2]); */
glVertex3d(nodes[n3][0] - ref.x, nodes[n3][1] - ref.y, xglVertex3d(nodes[n1][0] - ref.x, nodes[n1][1] - ref.y,
nodes[n3][2] - ref.z); nodes[n1][2] - ref.z);
/* xglNormal3d(normals[n2][0], normals[n2][1], normals[n2][2]); */
xglVertex3d(nodes[n2][0] - ref.x, nodes[n2][1] - ref.y,
nodes[n2][2] - ref.z);
/* xglNormal3d(normals[n3][0], normals[n3][1], normals[n3][2]); */
xglVertex3d(nodes[n3][0] - ref.x, nodes[n3][1] - ref.y,
nodes[n3][2] - ref.z);
odd = 1 - odd;
last1 = n2;
last2 = n3;
if ( n4 > 0 ) { if ( n4 > 0 ) {
glNormal3d(normals[n4][0], normals[n4][1], normals[n4][2]); if ( odd ) {
glVertex3d(nodes[n4][0] - ref.x, nodes[n4][1] - ref.y, calc_normal(nodes[last1], nodes[last2], nodes[n4],
nodes[n4][2] - ref.z); approx_normal);
} else {
calc_normal(nodes[last2], nodes[last1], nodes[n4],
approx_normal);
}
calc_normal(nodes[n3], nodes[n2], nodes[n4], approx_normal);
xglNormal3dv(approx_normal);
/*xglNormal3d(normals[n4][0], normals[n4][1], normals[n4][2]);*/
xglVertex3d(nodes[n4][0] - ref.x, nodes[n4][1] - ref.y,
nodes[n4][2] - ref.z);
odd = 1 - odd;
last1 = n3;
last2 = n4;
} }
} else if ( line[0] == 'f' ) { } else if ( line[0] == 'f' ) {
/* unoptimized face */ /* unoptimized face */
if ( !first ) { if ( !first ) {
/* close out the previous structure and start the next */ /* close out the previous structure and start the next */
glEnd(); xglEnd();
} else { } else {
first = 0; first = 0;
} }
glBegin(GL_TRIANGLES); xglBegin(GL_TRIANGLES);
/* printf("new triangle = %s", line);*/ /* printf("new triangle = %s", line);*/
sscanf(line, "f %d %d %d\n", &n1, &n2, &n3); sscanf(line, "f %d %d %d\n", &n1, &n2, &n3);
glNormal3d(normals[n1][0], normals[n1][1], normals[n1][2]); xglNormal3d(normals[n1][0], normals[n1][1], normals[n1][2]);
glVertex3d(nodes[n1][0] - ref.x, nodes[n1][1] - ref.y, xglVertex3d(nodes[n1][0] - ref.x, nodes[n1][1] - ref.y,
nodes[n1][2] - ref.z); nodes[n1][2] - ref.z);
glNormal3d(normals[n2][0], normals[n2][1], normals[n2][2]); xglNormal3d(normals[n2][0], normals[n2][1], normals[n2][2]);
glVertex3d(nodes[n2][0] - ref.x, nodes[n2][1] - ref.y, xglVertex3d(nodes[n2][0] - ref.x, nodes[n2][1] - ref.y,
nodes[n2][2] - ref.z); nodes[n2][2] - ref.z);
glNormal3d(normals[n3][0], normals[n3][1], normals[n3][2]); xglNormal3d(normals[n3][0], normals[n3][1], normals[n3][2]);
glVertex3d(nodes[n3][0] - ref.x, nodes[n3][1] - ref.y, xglVertex3d(nodes[n3][0] - ref.x, nodes[n3][1] - ref.y,
nodes[n3][2] - ref.z); nodes[n3][2] - ref.z);
} else if ( line[0] == 'q' ) { } else if ( line[0] == 'q' ) {
/* continue a triangle strip */ /* continue a triangle strip */
n1 = n2 = 0; n1 = n2 = 0;
@ -207,39 +258,65 @@ GLint fgObjLoad(char *path) {
sscanf(line, "q %d %d\n", &n1, &n2); sscanf(line, "q %d %d\n", &n1, &n2);
/* printf("read %d %d\n", n1, n2); */ /* printf("read %d %d\n", n1, n2); */
glNormal3d(normals[n1][0], normals[n1][1], normals[n1][2]); if ( odd ) {
glVertex3d(nodes[n1][0] - ref.x, nodes[n1][1] - ref.y, calc_normal(nodes[last1], nodes[last2], nodes[n1],
nodes[n1][2] - ref.z); approx_normal);
} else {
calc_normal(nodes[last2], nodes[last1], nodes[n1],
approx_normal);
}
xglNormal3dv(approx_normal);
/* xglNormal3d(normals[n1][0], normals[n1][1], normals[n1][2]); */
xglVertex3d(nodes[n1][0] - ref.x, nodes[n1][1] - ref.y,
nodes[n1][2] - ref.z);
odd = 1 - odd;
last1 = last2;
last2 = n1;
if ( n2 > 0 ) { if ( n2 > 0 ) {
/* printf(" (cont)\n"); */ /* printf(" (cont)\n"); */
glNormal3d(normals[n2][0], normals[n2][1], normals[n2][2]); if ( odd ) {
glVertex3d(nodes[n2][0] - ref.x, nodes[n2][1] - ref.y, calc_normal(nodes[last1], nodes[last2], nodes[n2],
nodes[n2][2] - ref.z); approx_normal);
} else {
calc_normal(nodes[last2], nodes[last1], nodes[n2],
approx_normal);
}
xglNormal3dv(approx_normal);
/*xglNormal3d(normals[n2][0], normals[n2][1], normals[n2][2]);*/
xglVertex3d(nodes[n2][0] - ref.x, nodes[n2][1] - ref.y,
nodes[n2][2] - ref.z);
odd = 1 -odd;
last1 = last2;
last2 = n2;
} }
} else { } else {
printf("Unknown line in %s = %s\n", path, line); printf("Unknown line in %s = %s\n", path, line);
} }
} }
glEnd(); xglEnd();
/* Draw normal vectors (for visually verifying normals)*/ /* Draw normal vectors (for visually verifying normals)*/
/* /*
glBegin(GL_LINES); xglBegin(GL_LINES);
glColor3f(0.0, 0.0, 0.0); xglColor3f(0.0, 0.0, 0.0);
for ( i = 0; i < ncount; i++ ) { for ( i = 0; i < ncount; i++ ) {
glVertex3d(nodes[i][0] - ref.x, xglVertex3d(nodes[i][0] - ref.x,
nodes[i][1] - ref.y, nodes[i][1] - ref.y,
nodes[i][2] - ref.z); nodes[i][2] - ref.z);
glVertex3d(nodes[i][0] - ref.x + 500*normals[i][0], xglVertex3d(nodes[i][0] - ref.x + 500*normals[i][0],
nodes[i][1] - ref.y + 500*normals[i][1], nodes[i][1] - ref.y + 500*normals[i][1],
nodes[i][2] - ref.z + 500*normals[i][2]); nodes[i][2] - ref.z + 500*normals[i][2]);
} }
glEnd(); xglEnd();
*/ */
glEndList(); xglEndList();
fclose(f); fclose(f);
@ -248,9 +325,13 @@ GLint fgObjLoad(char *path) {
/* $Log$ /* $Log$
/* Revision 1.10 1997/12/12 21:41:28 curt /* Revision 1.11 1997/12/15 23:55:01 curt
/* More light/material property tweaking ... still a ways off. /* Add xgl wrappers for debugging.
/* Generate terrain normals on the fly.
/* /*
* 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 * Revision 1.9 1997/12/12 19:52:57 curt
* Working on lightling and material properties. * Working on lightling and material properties.
* *

View file

@ -27,7 +27,7 @@
#include "orbits.h" #include "orbits.h"
#include "../general.h" #include "../Include/general.h"
#include "../Time/fg_time.h" #include "../Time/fg_time.h"
@ -170,10 +170,14 @@ void fgSolarSystemUpdate(struct OrbElements *planet, struct fgTIME t)
/* $Log$ /* $Log$
/* Revision 1.4 1997/12/10 22:37:51 curt /* Revision 1.5 1997/12/15 23:55:02 curt
/* Prepended "fg" on the name of all global structures that didn't have it yet. /* Add xgl wrappers for debugging.
/* i.e. "struct WEATHER {}" became "struct fgWEATHER {}" /* Generate terrain normals on the fly.
/* /*
* Revision 1.4 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 {}"
*
* Revision 1.3 1997/11/25 23:20:44 curt * Revision 1.3 1997/11/25 23:20:44 curt
* Changed planets.dat Planets.dat * Changed planets.dat Planets.dat
* *

View file

@ -29,10 +29,12 @@
#endif #endif
#include <GL/glut.h> #include <GL/glut.h>
#include "../XGL/xgl.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "../general.h" #include "../Include/general.h"
#include "astro.h" #include "astro.h"
#include "obj.h" #include "obj.h"
@ -80,27 +82,31 @@ void fgSceneryUpdate(double lon, double lat, double elev) {
/* Render out the current scene */ /* Render out the current scene */
void fgSceneryRender() { void fgSceneryRender() {
static GLfloat terrain_color[4] = { 0.4, 0.8, 0.3, 1.0 }; static GLfloat terrain_color[4] = { 0.6, 0.8, 0.4, 1.0 };
static GLfloat terrain_ambient[4]; static GLfloat terrain_ambient[4];
static GLfloat terrain_diffuse[4]; static GLfloat terrain_diffuse[4];
int i; int i;
for ( i = 0; i < 4; i++ ) { for ( i = 0; i < 4; i++ ) {
terrain_ambient[i] = terrain_color[i]; terrain_ambient[i] = terrain_color[i] * 0.5;
terrain_diffuse[i] = terrain_color[i]; terrain_diffuse[i] = terrain_color[i];
} }
glMaterialfv(GL_FRONT, GL_AMBIENT, terrain_ambient); xglMaterialfv(GL_FRONT, GL_AMBIENT, terrain_ambient);
glMaterialfv(GL_FRONT, GL_DIFFUSE, terrain_diffuse); xglMaterialfv(GL_FRONT, GL_DIFFUSE, terrain_diffuse);
glCallList(area_terrain); xglCallList(area_terrain);
} }
/* $Log$ /* $Log$
/* Revision 1.27 1997/12/12 21:41:30 curt /* Revision 1.28 1997/12/15 23:55:02 curt
/* More light/material property tweaking ... still a ways off. /* Add xgl wrappers for debugging.
/* Generate terrain normals on the fly.
/* /*
* 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 * Revision 1.26 1997/12/12 19:52:58 curt
* Working on lightling and material properties. * Working on lightling and material properties.
* *

View file

@ -28,7 +28,7 @@
#define SCENERY_H #define SCENERY_H
#include "../types.h" #include "../Include/types.h"
/* Define a structure containing global scenery parameters */ /* Define a structure containing global scenery parameters */
@ -63,10 +63,14 @@ void fgSceneryRender();
/* $Log$ /* $Log$
/* Revision 1.11 1997/12/10 22:37:52 curt /* Revision 1.12 1997/12/15 23:55:03 curt
/* Prepended "fg" on the name of all global structures that didn't have it yet. /* Add xgl wrappers for debugging.
/* i.e. "struct WEATHER {}" became "struct fgWEATHER {}" /* Generate terrain normals on the fly.
/* /*
* Revision 1.11 1997/12/10 22:37:52 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.10 1997/09/04 02:17:37 curt * Revision 1.10 1997/09/04 02:17:37 curt
* Shufflin' stuff. * Shufflin' stuff.
* *

View file

@ -34,13 +34,14 @@
#include <time.h> #include <time.h>
#include <GL/glut.h> #include <GL/glut.h>
#include "../XGL/xgl.h"
#include "orbits.h" #include "orbits.h"
#include "planets.h" #include "planets.h"
#include "stars.h" #include "stars.h"
#include "../constants.h" #include "../Include/constants.h"
#include "../general.h" #include "../Include/general.h"
#include "../Aircraft/aircraft.h" #include "../Aircraft/aircraft.h"
#include "../Main/views.h" #include "../Main/views.h"
#include "../Time/fg_time.h" #include "../Time/fg_time.h"
@ -85,9 +86,9 @@ void fgStarsInit() {
return; return;
} }
stars[i] = glGenLists(1); stars[i] = xglGenLists(1);
glNewList( stars[i], GL_COMPILE ); xglNewList( stars[i], GL_COMPILE );
glBegin( GL_POINTS ); xglBegin( GL_POINTS );
/* read in each line of the file */ /* read in each line of the file */
count = 0; count = 0;
@ -150,11 +151,11 @@ void fgStarsInit() {
/* printf("Found star: %d %s, %.3f %.3f %.3f\n", count, /* printf("Found star: %d %s, %.3f %.3f %.3f\n", count,
name, right_ascension, declination, magnitude); */ name, right_ascension, declination, magnitude); */
glColor3f( magnitude, magnitude, magnitude ); xglColor3f( magnitude, magnitude, magnitude );
/*glColor3f(0,0,0);*/ /*xglColor3f(0,0,0);*/
glVertex3f( 190000.0 * cos(right_ascension) * cos(declination), xglVertex3f( 190000.0 * cos(right_ascension) * cos(declination),
190000.0 * sin(right_ascension) * cos(declination), 190000.0 * sin(right_ascension) * cos(declination),
190000.0 * sin(declination) ); 190000.0 * sin(declination) );
count++; count++;
} /* if valid line */ } /* if valid line */
@ -170,52 +171,52 @@ void fgStarsInit() {
printf("Planet found at %f (ra), %f (dec)\n", printf("Planet found at %f (ra), %f (dec)\n",
pltPos.RightAscension, pltPos.Declination); pltPos.RightAscension, pltPos.Declination);
/* give the planets a temporary color, for testing purposes */ /* give the planets a temporary color, for testing purposes */
glColor3f( 1.0, 0.0, 0.0); xglColor3f( 1.0, 0.0, 0.0);
glVertex3f( 190000.0 * cos(pltPos.RightAscension) * xglVertex3f( 190000.0 * cos(pltPos.RightAscension) *
cos(pltPos.Declination), cos(pltPos.Declination),
190000.0 * sin(pltPos.RightAscension) * 190000.0 * sin(pltPos.RightAscension) *
cos(pltPos.Declination), cos(pltPos.Declination),
190000.0 * sin(pltPos.Declination) ); 190000.0 * sin(pltPos.Declination) );
} }
glEnd(); xglEnd();
/* /*
glBegin(GL_LINE_LOOP); xglBegin(GL_LINE_LOOP);
glColor3f(1.0, 0.0, 0.0); xglColor3f(1.0, 0.0, 0.0);
glVertex3f( 190000.0 * cos(ra_save-0.2) * cos(decl_save-0.2), xglVertex3f( 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(ra_save-0.2) * cos(decl_save-0.2),
190000.0 * sin(decl_save-0.2) ); 190000.0 * sin(decl_save-0.2) );
glVertex3f( 190000.0 * cos(ra_save+0.2) * cos(decl_save-0.2), xglVertex3f( 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(ra_save+0.2) * cos(decl_save-0.2),
190000.0 * sin(decl_save-0.2) ); 190000.0 * sin(decl_save-0.2) );
glVertex3f( 190000.0 * cos(ra_save+0.2) * cos(decl_save+0.2), xglVertex3f( 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(ra_save+0.2) * cos(decl_save+0.2),
190000.0 * sin(decl_save+0.2) ); 190000.0 * sin(decl_save+0.2) );
glVertex3f( 190000.0 * cos(ra_save-0.2) * cos(decl_save+0.2), xglVertex3f( 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(ra_save-0.2) * cos(decl_save+0.2),
190000.0 * sin(decl_save+0.2) ); 190000.0 * sin(decl_save+0.2) );
glEnd(); xglEnd();
*/ */
/* /*
glBegin(GL_LINE_LOOP); xglBegin(GL_LINE_LOOP);
glColor3f(0.0, 1.0, 0.0); xglColor3f(0.0, 1.0, 0.0);
glVertex3f( 190000.0 * cos(ra_save1-0.2) * cos(decl_save1-0.2), xglVertex3f( 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(ra_save1-0.2) * cos(decl_save1-0.2),
190000.0 * sin(decl_save1-0.2) ); 190000.0 * sin(decl_save1-0.2) );
glVertex3f( 190000.0 * cos(ra_save1+0.2) * cos(decl_save1-0.2), xglVertex3f( 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(ra_save1+0.2) * cos(decl_save1-0.2),
190000.0 * sin(decl_save1-0.2) ); 190000.0 * sin(decl_save1-0.2) );
glVertex3f( 190000.0 * cos(ra_save1+0.2) * cos(decl_save1+0.2), xglVertex3f( 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(ra_save1+0.2) * cos(decl_save1+0.2),
190000.0 * sin(decl_save1+0.2) ); 190000.0 * sin(decl_save1+0.2) );
glVertex3f( 190000.0 * cos(ra_save1-0.2) * cos(decl_save1+0.2), xglVertex3f( 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(ra_save1-0.2) * cos(decl_save1+0.2),
190000.0 * sin(decl_save1+0.2) ); 190000.0 * sin(decl_save1+0.2) );
glEnd(); xglEnd();
*/ */
glEndList(); xglEndList();
max_stars /= 2; max_stars /= 2;
} }
@ -254,9 +255,9 @@ void fgStarsRender() {
printf("RENDERING STARS = %d (night)\n", i); printf("RENDERING STARS = %d (night)\n", i);
glDisable( GL_LIGHTING ); xglDisable( GL_LIGHTING );
glCallList(stars[i]); xglCallList(stars[i]);
glEnable( GL_LIGHTING ); xglEnable( GL_LIGHTING );
} else { } else {
printf("not RENDERING STARS (day)\n"); printf("not RENDERING STARS (day)\n");
} }
@ -264,9 +265,13 @@ void fgStarsRender() {
/* $Log$ /* $Log$
/* Revision 1.19 1997/12/12 19:53:00 curt /* Revision 1.20 1997/12/15 23:55:03 curt
/* Working on lightling and material properties. /* Add xgl wrappers for debugging.
/* Generate terrain normals on the fly.
/* /*
* Revision 1.19 1997/12/12 19:53:00 curt
* Working on lightling and material properties.
*
* Revision 1.18 1997/12/10 22:37:52 curt * Revision 1.18 1997/12/10 22:37:52 curt
* Prepended "fg" on the name of all global structures that didn't have it yet. * Prepended "fg" on the name of all global structures that didn't have it yet.
* i.e. "struct WEATHER {}" became "struct fgWEATHER {}" * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"

View file

@ -23,6 +23,8 @@
**************************************************************************/ **************************************************************************/
#include <GL/glut.h> #include <GL/glut.h>
#include "../XGL/xgl.h"
#include "../Time/fg_time.h" #include "../Time/fg_time.h"
#include "../Main/views.h" #include "../Main/views.h"
#include "orbits.h" #include "orbits.h"
@ -95,10 +97,10 @@ void fgSunInit()
{ {
// int i; // int i;
sun_obj = glGenLists(1); sun_obj = xglGenLists(1);
glNewList(sun_obj, GL_COMPILE ); xglNewList(sun_obj, GL_COMPILE );
// glBegin( GL_POINTS ); // xglBegin( GL_POINTS );
fgSolarSystemUpdate(&(pltOrbElements[0]), cur_time_params); fgSolarSystemUpdate(&(pltOrbElements[0]), cur_time_params);
sunPos = fgCalculateSun(pltOrbElements[0], cur_time_params); sunPos = fgCalculateSun(pltOrbElements[0], cur_time_params);
@ -108,13 +110,13 @@ void fgSunInit()
#endif #endif
/* give the moon a temporary color, for testing purposes */ /* give the moon a temporary color, for testing purposes */
// glColor3f( 0.0, 1.0, 0.0); // xglColor3f( 0.0, 1.0, 0.0);
// glVertex3f( 190000.0 * cos(moonPos.RightAscension) * cos(moonPos.Declination), // xglVertex3f( 190000.0 * cos(moonPos.RightAscension) * cos(moonPos.Declination),
// 190000.0 * sin(moonPos.RightAscension) * cos(moonPos.Declination), // 190000.0 * sin(moonPos.RightAscension) * cos(moonPos.Declination),
// 190000.0 * sin(moonPos.Declination) ); // 190000.0 * sin(moonPos.Declination) );
//glVertex3f(0.0, 0.0, 0.0); //xglVertex3f(0.0, 0.0, 0.0);
// glEnd(); // xglEnd();
// glColor3f(1.0, 1.0, 1.0); // xglColor3f(1.0, 1.0, 1.0);
//xMoon = 190000.0 * cos(moonPos.RightAscension) * cos(moonPos.Declination); //xMoon = 190000.0 * cos(moonPos.RightAscension) * cos(moonPos.Declination);
//yMoon = 190000.0 * sin(moonPos.RightAscension) * cos(moonPos.Declination); //yMoon = 190000.0 * sin(moonPos.RightAscension) * cos(moonPos.Declination);
//zMoon = 190000.0 * sin(moonPos.Declination); //zMoon = 190000.0 * sin(moonPos.Declination);
@ -123,22 +125,22 @@ void fgSunInit()
ySun = 60000.0 * sin(sunPos.RightAscension) * cos(sunPos.Declination); ySun = 60000.0 * sin(sunPos.RightAscension) * cos(sunPos.Declination);
zSun = 60000.0 * sin(sunPos.Declination); zSun = 60000.0 * sin(sunPos.Declination);
// glPushMatrix(); // xglPushMatrix();
// glTranslatef(x, y, z); // xglTranslatef(x, y, z);
// glScalef(16622.8, 16622.8, 16622.8); // xglScalef(16622.8, 16622.8, 16622.8);
// glBegin(GL_TRIANGLES); // xglBegin(GL_TRIANGLES);
// for (i = 0; i < 20; i++) // for (i = 0; i < 20; i++)
// subdivide(&vdata[tindices[i][0]][0], // subdivide(&vdata[tindices[i][0]][0],
// &vdata[tindices[i][1]][0], // &vdata[tindices[i][1]][0],
// &vdata[tindices[i][2]][0], 3); // &vdata[tindices[i][2]][0], 3);
// glutSolidSphere(1.0, 25, 25); // glutSolidSphere(1.0, 25, 25);
// glEnd(); // xglEnd();
//glPopMatrix(); //xglPopMatrix();
glutSolidSphere(1.0, 10, 10); glutSolidSphere(1.0, 10, 10);
glEndList(); xglEndList();
} }
@ -178,33 +180,37 @@ void fgSunRender() {
diff[3] = 0.0; */ diff[3] = 0.0; */
/* set lighting parameters */ /* set lighting parameters */
/* glLightfv(GL_LIGHT0, GL_AMBIENT, color ); /* xglLightfv(GL_LIGHT0, GL_AMBIENT, color );
glLightfv(GL_LIGHT0, GL_DIFFUSE, color ); xglLightfv(GL_LIGHT0, GL_DIFFUSE, color );
glMaterialfv(GL_FRONT, GL_AMBIENT, amb); xglMaterialfv(GL_FRONT, GL_AMBIENT, amb);
glMaterialfv(GL_FRONT, GL_DIFFUSE, diff); */ xglMaterialfv(GL_FRONT, GL_DIFFUSE, diff); */
glDisable( GL_LIGHTING ); xglDisable( GL_LIGHTING );
glPushMatrix(); xglPushMatrix();
glTranslatef(xSun, ySun, zSun); xglTranslatef(xSun, ySun, zSun);
glScalef(1400, 1400, 1400); xglScalef(1400, 1400, 1400);
glColor3f(0.85, 0.65, 0.05); xglColor3f(0.85, 0.65, 0.05);
/* glColor3fv( color ); */ /* xglColor3fv( color ); */
/* glutSolidSphere(1.0, 25, 25); */ /* xglutSolidSphere(1.0, 25, 25); */
glCallList(sun_obj); xglCallList(sun_obj);
glPopMatrix(); xglPopMatrix();
glEnable( GL_LIGHTING ); xglEnable( GL_LIGHTING );
} }
/* $Log$ /* $Log$
/* Revision 1.5 1997/12/12 21:41:31 curt /* Revision 1.6 1997/12/15 23:55:04 curt
/* More light/material property tweaking ... still a ways off. /* Add xgl wrappers for debugging.
/* Generate terrain normals on the fly.
/* /*
* 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 * 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. * Prepended "fg" on the name of all global structures that didn't have it yet.
* i.e. "struct WEATHER {}" became "struct fgWEATHER {}" * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"

View file

@ -28,7 +28,8 @@ include make.inc
SUBSUBDIRS = Flight/LaRCsim Flight/Slew SUBSUBDIRS = Flight/LaRCsim Flight/Slew
SUBDIRS = Aircraft Cockpit Controls Flight Joystick Math Scenery Time Weather SUBDIRS = Aircraft Cockpit Controls Flight Joystick Math Scenery Time Weather \
XGL
MAIN = Main MAIN = Main
@ -95,6 +96,10 @@ bin-zip:
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# $Log$ # $Log$
# Revision 1.32 1997/12/15 23:54:25 curt
# Add xgl wrappers for debugging.
# Generate terrain normals on the fly.
#
# Revision 1.31 1997/12/15 20:59:08 curt # Revision 1.31 1997/12/15 20:59:08 curt
# Misc. tweaks. # Misc. tweaks.
# #

View file

@ -30,7 +30,7 @@
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
FG_VERSION_MAJOR = 0 FG_VERSION_MAJOR = 0
FG_VERSION_MINOR = 17 FG_VERSION_MINOR = 18
FG_VERSION = $(FG_VERSION_MAJOR).$(FG_VERSION_MINOR) FG_VERSION = $(FG_VERSION_MAJOR).$(FG_VERSION_MINOR)
@ -60,6 +60,8 @@ LN = ln -sf
# #
# -O3 -fomit-frame-pointer -funroll-all-loops -ffast-math # -O3 -fomit-frame-pointer -funroll-all-loops -ffast-math
# - Other potential compiler optimization flags # - Other potential compiler optimization flags
#
# -
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GLOBAL_CFLAGS = -g -Wall -DVERSION=\"$(FG_VERSION)\" GLOBAL_CFLAGS = -g -Wall -DVERSION=\"$(FG_VERSION)\"
@ -86,6 +88,17 @@ GLOBAL_CFLAGS = -g -Wall -DVERSION=\"$(FG_VERSION)\"
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# Debugging options.
#
# Uncomment the following two lines to enable OpenGL function call tracing.
# This mechanism is provided courtesy of Steve Baker <sbaker@link.com>
#---------------------------------------------------------------------------
# FG_DEBUG_FLAGS = -DXGL_TRACE
# FG_DEBUG_LIBS = ../XGL/libXGL.a
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Uncomment one of the following sections depending on your system # Uncomment one of the following sections depending on your system
# #
@ -102,7 +115,7 @@ INTERFACE_FILES = GLUTmain.c GLUTkey.c
MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
X11_LIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 X11_LIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS) GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
FG_CFLAGS = $(GLOBAL_CFLAGS) FG_CFLAGS = $(GLOBAL_CFLAGS) $(FG_DEBUG_FLAGS)
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@ -114,7 +127,7 @@ FG_CFLAGS = $(GLOBAL_CFLAGS)
# INTERFACE_LIBS = -lglut # INTERFACE_LIBS = -lglut
# INTERFACE_FILES = GLUTmain.c GLUTkey.c # INTERFACE_FILES = GLUTmain.c GLUTkey.c
# GRAPHICS_LIBS = -lGLU -lGL -lXmu -lX11 # GRAPHICS_LIBS = -lGLU -lGL -lXmu -lX11
# FG_CFLAGS = $(GLOBAL_CFLAGS) # FG_CFLAGS = $(GLOBAL_CFLAGS) $(FG_DEBUG_FLAGS)
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@ -125,7 +138,7 @@ FG_CFLAGS = $(GLOBAL_CFLAGS)
# INTERFACE_LIBS = -lglut # INTERFACE_LIBS = -lglut
# INTERFACE_FILES = GLUTmain.c GLUTkey.c # INTERFACE_FILES = GLUTmain.c GLUTkey.c
# GRAPHICS_LIBS = -lGLU -lGL -lXext -lXmu -lXi -lX11 # GRAPHICS_LIBS = -lGLU -lGL -lXext -lXmu -lXi -lX11
# FG_CFLAGS = $(GLOBAL_CFLAGS) # FG_CFLAGS = $(GLOBAL_CFLAGS) $(FG_DEBUG_FLAGS)
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@ -135,13 +148,17 @@ FG_CFLAGS = $(GLOBAL_CFLAGS)
# INTERFACE_LIBS = ../Win32/libglut.a # INTERFACE_LIBS = ../Win32/libglut.a
# INTERFACE_FILES = GLUTmain.c GLUTkey.c # INTERFACE_FILES = GLUTmain.c GLUTkey.c
# GRAPHICS_LIBS = -lglu32 -lopengl32 -luser32 -lgdi32 # GRAPHICS_LIBS = -lglu32 -lopengl32 -luser32 -lgdi32
# FG_CFLAGS = $(GLOBAL_CFLAGS) -DWIN32 -DUSE_RAND # FG_CFLAGS = $(GLOBAL_CFLAGS) $(FG_DEBUG_FLAGS) -DWIN32 -DUSE_RAND
# LN = copy # LN = copy
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# $Log$ # $Log$
# Revision 1.25 1997/12/15 23:54:26 curt
# Add xgl wrappers for debugging.
# Generate terrain normals on the fly.
#
# Revision 1.24 1997/12/12 21:41:24 curt # Revision 1.24 1997/12/12 21:41:24 curt
# More light/material property tweaking ... still a ways off. # More light/material property tweaking ... still a ways off.
# #

View file

@ -2,5 +2,5 @@ slew.o: slew.c slew.h ../flight.h ../Slew/slew.h \
../LaRCsim/ls_interface.h ../LaRCsim/../flight.h \ ../LaRCsim/ls_interface.h ../LaRCsim/../flight.h \
../../Aircraft/aircraft.h ../../Aircraft/../Flight/flight.h \ ../../Aircraft/aircraft.h ../../Aircraft/../Flight/flight.h \
../../Aircraft/../Controls/controls.h \ ../../Aircraft/../Controls/controls.h \
../../Aircraft/../Controls/../limits.h ../../Controls/controls.h \ ../../Aircraft/../Controls/../Include/limits.h \
../../constants.h ../../Controls/controls.h ../../Include/constants.h

View file

@ -30,7 +30,7 @@
#include "../flight.h" #include "../flight.h"
#include "../../Aircraft/aircraft.h" #include "../../Aircraft/aircraft.h"
#include "../../Controls/controls.h" #include "../../Controls/controls.h"
#include "../../constants.h" #include "../../Include/constants.h"
#ifndef M_PI #ifndef M_PI
@ -91,9 +91,13 @@ void fgSlewUpdate() {
/* $Log$ /* $Log$
/* Revision 1.6 1997/08/27 03:30:11 curt /* Revision 1.7 1997/12/15 23:54:42 curt
/* Changed naming scheme of basic shared structures. /* Add xgl wrappers for debugging.
/* Generate terrain normals on the fly.
/* /*
* Revision 1.6 1997/08/27 03:30:11 curt
* Changed naming scheme of basic shared structures.
*
* Revision 1.5 1997/07/19 22:35:06 curt * Revision 1.5 1997/07/19 22:35:06 curt
* Moved fiddled with PI to avoid compiler warnings. * Moved fiddled with PI to avoid compiler warnings.
* *

View file

@ -1,12 +1,14 @@
fg_time.o: fg_time.c fg_time.h ../types.h ../Flight/flight.h \ fg_time.o: fg_time.c fg_time.h ../Include/types.h ../Flight/flight.h \
../Flight/Slew/slew.h ../Flight/LaRCsim/ls_interface.h \ ../Flight/Slew/slew.h ../Flight/LaRCsim/ls_interface.h \
../Flight/LaRCsim/../flight.h ../constants.h ../Time/fg_time.h ../Flight/LaRCsim/../flight.h ../Include/constants.h \
../Time/fg_time.h
fg_timer.o: fg_timer.c fg_timer.h fg_timer.o: fg_timer.c fg_timer.h
sidereal.o: sidereal.c ../constants.h sidereal.o: sidereal.c ../Include/constants.h
sunpos.o: sunpos.c sunpos.h ../types.h fg_time.h ../Flight/flight.h \ sunpos.o: sunpos.c sunpos.h ../Include/types.h fg_time.h \
../Flight/Slew/slew.h ../Flight/LaRCsim/ls_interface.h \ ../Flight/flight.h ../Flight/Slew/slew.h \
../Flight/LaRCsim/../flight.h ../constants.h ../Main/views.h \ ../Flight/LaRCsim/ls_interface.h ../Flight/LaRCsim/../flight.h \
../Main/../types.h ../Main/../Flight/flight.h ../Main/../Math/mat3.h \ ../Include/constants.h ../Main/views.h ../Main/../Include/types.h \
../Main/../Flight/flight.h ../Main/../Math/mat3.h \
../Math/fg_geodesy.h ../Math/mat3.h ../Math/polar.h \ ../Math/fg_geodesy.h ../Math/mat3.h ../Math/polar.h \
../Math/../types.h ../Math/../Include/types.h
ttest.o: ttest.c ttest.o: ttest.c

View file

@ -35,7 +35,7 @@
#endif #endif
#include "fg_time.h" #include "fg_time.h"
#include "../constants.h" #include "../Include/constants.h"
#include "../Flight/flight.h" #include "../Flight/flight.h"
#include "../Time/fg_time.h" #include "../Time/fg_time.h"
@ -285,9 +285,13 @@ void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t) {
/* $Log$ /* $Log$
/* Revision 1.19 1997/12/15 20:59:10 curt /* Revision 1.20 1997/12/15 23:55:06 curt
/* Misc. tweaks. /* Add xgl wrappers for debugging.
/* Generate terrain normals on the fly.
/* /*
* Revision 1.19 1997/12/15 20:59:10 curt
* Misc. tweaks.
*
* Revision 1.18 1997/12/12 21:41:31 curt * Revision 1.18 1997/12/12 21:41:31 curt
* More light/material property tweaking ... still a ways off. * More light/material property tweaking ... still a ways off.
* *

View file

@ -35,7 +35,7 @@
#include <GL/glut.h> #include <GL/glut.h>
#include <time.h> #include <time.h>
#include "../types.h" #include "../Include/types.h"
#include "../Flight/flight.h" #include "../Flight/flight.h"
@ -92,10 +92,14 @@ void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t);
/* $Log$ /* $Log$
/* Revision 1.9 1997/12/10 22:37:55 curt /* Revision 1.10 1997/12/15 23:55:07 curt
/* Prepended "fg" on the name of all global structures that didn't have it yet. /* Add xgl wrappers for debugging.
/* i.e. "struct WEATHER {}" became "struct fgWEATHER {}" /* Generate terrain normals on the fly.
/* /*
* Revision 1.9 1997/12/10 22:37:55 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.8 1997/12/09 04:25:38 curt * Revision 1.8 1997/12/09 04:25:38 curt
* Working on adding a global lighting params structure. * Working on adding a global lighting params structure.
* *

View file

@ -45,7 +45,7 @@
#include "sunpos.h" #include "sunpos.h"
#include "fg_time.h" #include "fg_time.h"
#include "../constants.h" #include "../Include/constants.h"
#include "../Main/views.h" #include "../Main/views.h"
#include "../Math/fg_geodesy.h" #include "../Math/fg_geodesy.h"
#include "../Math/mat3.h" #include "../Math/mat3.h"
@ -316,10 +316,14 @@ void fgUpdateSunPos(struct fgCartesianPoint scenery_center) {
/* $Log$ /* $Log$
/* Revision 1.16 1997/12/11 04:43:57 curt /* Revision 1.17 1997/12/15 23:55:08 curt
/* Fixed sun vector and lighting problems. I thing the moon is now lit /* Add xgl wrappers for debugging.
/* correctly. /* Generate terrain normals on the fly.
/* /*
* Revision 1.16 1997/12/11 04:43:57 curt
* Fixed sun vector and lighting problems. I thing the moon is now lit
* correctly.
*
* Revision 1.15 1997/12/10 22:37:55 curt * Revision 1.15 1997/12/10 22:37:55 curt
* Prepended "fg" on the name of all global structures that didn't have it yet. * Prepended "fg" on the name of all global structures that didn't have it yet.
* i.e. "struct WEATHER {}" became "struct fgWEATHER {}" * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"

View file

@ -42,7 +42,7 @@
#include <time.h> #include <time.h>
#include "../types.h" #include "../Include/types.h"
/* update the cur_time_params structure with the current sun position */ /* update the cur_time_params structure with the current sun position */
void fgUpdateSunPos(struct fgCartesianPoint scenery_center); void fgUpdateSunPos(struct fgCartesianPoint scenery_center);

View file

@ -3,4 +3,4 @@ weather.o: weather.c weather.h ../Aircraft/aircraft.h \
../Aircraft/../Flight/LaRCsim/ls_interface.h \ ../Aircraft/../Flight/LaRCsim/ls_interface.h \
../Aircraft/../Flight/LaRCsim/../flight.h \ ../Aircraft/../Flight/LaRCsim/../flight.h \
../Aircraft/../Controls/controls.h \ ../Aircraft/../Controls/controls.h \
../Aircraft/../Controls/../limits.h ../Math/fg_random.h ../Aircraft/../Controls/../Include/limits.h ../Math/fg_random.h