/* 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();
}
/* render the stars */
fgStarsRender();
- /* render the moon */
- fgMoonRender();
-
/* render the sun */
fgSunRender();
+ /* render the moon */
+ fgMoonRender();
+
glPopMatrix();
/* reenable fog effects */
/* $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.
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;
void fgMoonInit() {
struct fgLIGHT *l;
- static GLfloat moon_color[4] = { 1.0, 1.0, 1.0, 1.0 };
// int i;
l = &cur_light_params;
/* 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;
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);
struct CelestialCoord fgCalculatePlanet(struct OrbElements planet,
- struct OrbElements sun,
+ struct OrbElements theSun,
struct fgTIME t)
{
struct CelestialCoord
*/
/* calculate the solar position */
- SolarPosition = fgCalcSunPos(sun);
+ SolarPosition = fgCalcSunPos(theSun);
xg = xh + SolarPosition.xs;
yg = yh + SolarPosition.ys;
zg = zh;
/* $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.
+ *
*/
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.
+ *
*/
#include "orbits.h"
#include "sun.h"
-GLint sun;
+GLint sun_obj;
static struct CelestialCoord sunPos;
{
// int i;
- sun = glGenLists(1);
- glNewList(sun, GL_COMPILE );
+ sun_obj = glGenLists(1);
+ glNewList(sun_obj, GL_COMPILE );
// glBegin( GL_POINTS );
// glEnd();
//glPopMatrix();
- glColor3f(0.85, 0.65, 0.05);
glutSolidSphere(1.0, 10, 10);
glEndList();
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();
/* $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.
*