More light/material property tweaking ... still a ways off.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -28,14 +28,17 @@
|
||||
|
||||
|
||||
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.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user