Working on lightling and material properties.
This commit is contained in:
+9
-3
@@ -89,6 +89,9 @@ void fgAstroRender() {
|
|||||||
/* Disable fog effects */
|
/* Disable fog effects */
|
||||||
glDisable( GL_FOG );
|
glDisable( GL_FOG );
|
||||||
|
|
||||||
|
/* set the sun position */
|
||||||
|
/* glLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec_inv );*/
|
||||||
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
|
||||||
/* Translate to view position */
|
/* Translate to view position */
|
||||||
@@ -118,10 +121,13 @@ void fgAstroRender() {
|
|||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.4 1997/12/11 04:43:56 curt
|
/* Revision 1.5 1997/12/12 19:52:54 curt
|
||||||
/* Fixed sun vector and lighting problems. I thing the moon is now lit
|
/* Working on lightling and material properties.
|
||||||
/* correctly.
|
|
||||||
/*
|
/*
|
||||||
|
* 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
|
* 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.
|
* 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 {}"
|
||||||
|
|||||||
+10
-3
@@ -225,10 +225,18 @@ struct CelestialCoord fgCalculateMoon(struct OrbElements params,
|
|||||||
|
|
||||||
|
|
||||||
void fgMoonInit() {
|
void fgMoonInit() {
|
||||||
|
struct fgLIGHT *l;
|
||||||
|
static GLfloat moon_color[4] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
// int i;
|
// int i;
|
||||||
|
|
||||||
|
l = &cur_light_params;
|
||||||
|
|
||||||
moon = glGenLists(1);
|
moon = glGenLists(1);
|
||||||
glNewList(moon, GL_COMPILE );
|
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);
|
fgSolarSystemUpdate(&(pltOrbElements[1]), cur_time_params);
|
||||||
moonPos = fgCalculateMoon(pltOrbElements[1], pltOrbElements[0],
|
moonPos = fgCalculateMoon(pltOrbElements[1], pltOrbElements[0],
|
||||||
cur_time_params);
|
cur_time_params);
|
||||||
@@ -245,7 +253,6 @@ void fgMoonInit() {
|
|||||||
yMoon = 60000.0 * sin(moonPos.RightAscension) * cos(moonPos.Declination);
|
yMoon = 60000.0 * sin(moonPos.RightAscension) * cos(moonPos.Declination);
|
||||||
zMoon = 60000.0 * sin(moonPos.Declination);
|
zMoon = 60000.0 * sin(moonPos.Declination);
|
||||||
|
|
||||||
glColor3f(1.0, 1.0, 1.0);
|
|
||||||
glutSolidSphere(1.0, 10, 10);
|
glutSolidSphere(1.0, 10, 10);
|
||||||
|
|
||||||
glEndList();
|
glEndList();
|
||||||
@@ -255,13 +262,13 @@ void fgMoonInit() {
|
|||||||
/* Draw the moon */
|
/* Draw the moon */
|
||||||
void fgMoonRender() {
|
void fgMoonRender() {
|
||||||
struct fgLIGHT *l;
|
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;
|
l = &cur_light_params;
|
||||||
|
|
||||||
/* set lighting parameters */
|
/* set lighting parameters */
|
||||||
glLightfv(GL_LIGHT0, GL_AMBIENT, l->scene_clear );
|
glLightfv(GL_LIGHT0, GL_AMBIENT, l->scene_clear );
|
||||||
glLightfv(GL_LIGHT0, GL_DIFFUSE, color );
|
glLightfv(GL_LIGHT0, GL_DIFFUSE, moon_color );
|
||||||
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef(xMoon, yMoon, zMoon);
|
glTranslatef(xMoon, yMoon, zMoon);
|
||||||
|
|||||||
Reference in New Issue
Block a user