Working on lightling and material properties.

This commit is contained in:
curt
1997-12-12 19:52:47 +00:00
parent 5b779f5200
commit f711a02a62
2 changed files with 19 additions and 6 deletions

View File

@@ -89,6 +89,9 @@ void fgAstroRender() {
/* Disable fog effects */
glDisable( GL_FOG );
/* set the sun position */
/* glLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec_inv );*/
glPushMatrix();
/* Translate to view position */
@@ -118,10 +121,13 @@ void fgAstroRender() {
/* $Log$
/* Revision 1.4 1997/12/11 04:43:56 curt
/* Fixed sun vector and lighting problems. I thing the moon is now lit
/* correctly.
/* 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.
*
* Revision 1.3 1997/12/10 22:37:49 curt
* Prepended "fg" on the name of all global structures that didn't have it yet.
* i.e. "struct WEATHER {}" became "struct fgWEATHER {}"

View File

@@ -225,10 +225,18 @@ 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;
moon = glGenLists(1);
glNewList(moon, GL_COMPILE );
/* glMaterialfv(GL_FRONT, GL_AMBIENT, l->scene_clear);
glMaterialfv(GL_FRONT, GL_DIFFUSE, moon_color); */
fgSolarSystemUpdate(&(pltOrbElements[1]), cur_time_params);
moonPos = fgCalculateMoon(pltOrbElements[1], pltOrbElements[0],
cur_time_params);
@@ -245,7 +253,6 @@ void fgMoonInit() {
yMoon = 60000.0 * sin(moonPos.RightAscension) * cos(moonPos.Declination);
zMoon = 60000.0 * sin(moonPos.Declination);
glColor3f(1.0, 1.0, 1.0);
glutSolidSphere(1.0, 10, 10);
glEndList();
@@ -255,13 +262,13 @@ void fgMoonInit() {
/* Draw the moon */
void fgMoonRender() {
struct fgLIGHT *l;
GLfloat color[4] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat moon_color[4] = { 1.0, 1.0, 1.0, 1.0 };
l = &cur_light_params;
/* set lighting parameters */
glLightfv(GL_LIGHT0, GL_AMBIENT, l->scene_clear );
glLightfv(GL_LIGHT0, GL_DIFFUSE, color );
glLightfv(GL_LIGHT0, GL_DIFFUSE, moon_color );
glPushMatrix();
glTranslatef(xMoon, yMoon, zMoon);