1
0
Fork 0

Incorporated Durk's updates.

This commit is contained in:
curt 1998-03-09 22:47:25 +00:00
parent ca0362361f
commit 0d86b4c20f
3 changed files with 35 additions and 20 deletions

View file

@ -348,16 +348,20 @@ void fgSkyRender( void ) {
xglColor4fv( outer_color[0] ); xglColor4fv( outer_color[0] );
xglVertex3fv( outer_vertex[0] ); xglVertex3fv( outer_vertex[0] );
xglEnd(); xglEnd();
xglPopMatrix(); xglPopMatrix();
} }
/* $Log$ /* $Log$
/* Revision 1.7 1998/02/19 13:05:49 curt /* Revision 1.8 1998/03/09 22:47:25 curt
/* Incorporated some HUD tweaks from Michelle America. /* Incorporated Durk's updates.
/* Tweaked the sky's sunset/rise colors.
/* Other misc. tweaks.
/* /*
* Revision 1.7 1998/02/19 13:05:49 curt
* Incorporated some HUD tweaks from Michelle America.
* Tweaked the sky's sunset/rise colors.
* Other misc. tweaks.
*
* Revision 1.6 1998/02/07 15:29:32 curt * Revision 1.6 1998/02/07 15:29:32 curt
* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
* <chotchkiss@namg.us.anritsu.com> * <chotchkiss@namg.us.anritsu.com>

View file

@ -47,7 +47,7 @@ void fgCalcSunPos(struct OrbElements params)
EccAnom = fgCalcEccAnom(params.M, params.e); EccAnom = fgCalcEccAnom(params.M, params.e);
/* calculate the Suns distance (r) and its true anomaly (v) */ /* calculate the Suns distance (r) and its true anomaly (v) */
xv = cos(EccAnom) - params.e; xv = cos(EccAnom) - params.e;
yv = sqrt(1.0 - params.e*params.e) * sin(EccAnom); yv = sqrt(1.0 - params.e*params.e) * sin(EccAnom);
v = atan2(yv, xv); v = atan2(yv, xv);
r = sqrt(xv*xv + yv*yv); r = sqrt(xv*xv + yv*yv);
@ -64,24 +64,29 @@ void fgCalcSunPos(struct OrbElements params)
} }
struct CelestialCoord fgCalculateSun(struct OrbElements params, struct fgTIME t) struct CelestialCoord fgCalculateSun (struct OrbElements params,
struct fgTIME t)
{ {
struct CelestialCoord result; struct CelestialCoord result;
double xe, ye, ze, ecl, actTime; double xe, ye, ze, ecl, actTime;
/* calculate the angle between ecliptic and equatorial coordinate system */ /* calculate the angle between ecliptic and equatorial coordinate
actTime = fgCalcActTime(t); * system */
actTime = fgCalcActTime (t);
ecl = DEG_TO_RAD * (23.4393 - 3.563E-7 * actTime); // Angle now in Rads ecl = DEG_TO_RAD * (23.4393 - 3.563E-7 * actTime); // Angle now in Rads
/* calculate the sun's ecliptic position */
fgCalcSunPos (params);
/* convert ecliptic coordinates to equatorial rectangular /* convert ecliptic coordinates to equatorial rectangular
geocentric coordinates */ * geocentric coordinates */
xe = solarPosition.xs; xe = solarPosition.xs;
ye = solarPosition.ys * cos (ecl); ye = solarPosition.ys * cos (ecl);
ze = solarPosition.ys * sin (ecl); ze = solarPosition.ys * sin (ecl);
/* and finally... Calulate Right Ascention and Declination */ /* and finally... Calulate Right Ascention and Declination */
result.RightAscension = atan2( ye, xe); result.RightAscension = atan2 (ye, xe);
result.Declination = atan2(ze, sqrt(xe*xe + ye*ye)); result.Declination = atan2 (ze, sqrt (xe * xe + ye * ye));
return result; return result;
} }
@ -176,11 +181,14 @@ void fgSunRender( void ) {
/* $Log$ /* $Log$
/* Revision 1.7 1998/02/23 19:07:56 curt /* Revision 1.8 1998/03/09 22:47:25 curt
/* Incorporated Durk's Astro/ tweaks. Includes unifying the sun position /* Incorporated Durk's updates.
/* calculation code between sun display, and other FG sections that use this
/* for things like lighting.
/* /*
* Revision 1.7 1998/02/23 19:07:56 curt
* Incorporated Durk's Astro/ tweaks. Includes unifying the sun position
* calculation code between sun display, and other FG sections that use this
* for things like lighting.
*
* Revision 1.6 1998/02/12 21:59:39 curt * Revision 1.6 1998/02/12 21:59:39 curt
* Incorporated code changes contributed by Charlie Hotchkiss * Incorporated code changes contributed by Charlie Hotchkiss
* <chotchkiss@namg.us.anritsu.com> * <chotchkiss@namg.us.anritsu.com>

View file

@ -27,7 +27,7 @@
#define _SUN_H #define _SUN_H
extern struct fgSUNPOS solarPosition; extern fgSUNPOS solarPosition;
void fgCalcSunPos (struct OrbElements sunParams); void fgCalcSunPos (struct OrbElements sunParams);
@ -44,11 +44,14 @@ void fgSunRender( void );
/* $Log$ /* $Log$
/* Revision 1.4 1998/02/23 19:07:57 curt /* Revision 1.5 1998/03/09 22:47:26 curt
/* Incorporated Durk's Astro/ tweaks. Includes unifying the sun position /* Incorporated Durk's updates.
/* calculation code between sun display, and other FG sections that use this
/* for things like lighting.
/* /*
* Revision 1.4 1998/02/23 19:07:57 curt
* Incorporated Durk's Astro/ tweaks. Includes unifying the sun position
* calculation code between sun display, and other FG sections that use this
* for things like lighting.
*
* Revision 1.3 1998/01/22 02:59:29 curt * Revision 1.3 1998/01/22 02:59:29 curt
* Changed #ifdef FILE_H to #ifdef _FILE_H * Changed #ifdef FILE_H to #ifdef _FILE_H
* *