More tweaking with stars.
This commit is contained in:
parent
ad22cbffca
commit
5d76cf2eaa
6 changed files with 61 additions and 35 deletions
|
@ -467,7 +467,7 @@ double get_speed()
|
|||
struct FLIGHT *f;
|
||||
|
||||
f = ¤t_aircraft.flight;
|
||||
return( FG_V_true_kts );
|
||||
return( FG_V_equiv_kts );
|
||||
}
|
||||
|
||||
double get_aoa()
|
||||
|
@ -499,7 +499,7 @@ double get_heading()
|
|||
struct FLIGHT *f;
|
||||
|
||||
f = ¤t_aircraft.flight;
|
||||
return( FG_Gamma_horiz_rad*RAD_TO_DEG );
|
||||
return( FG_Psi*RAD_TO_DEG );
|
||||
}
|
||||
|
||||
double get_altitude()
|
||||
|
@ -799,9 +799,12 @@ void fgUpdateHUD( Hptr hud )
|
|||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.2 1997/09/04 02:17:30 curt
|
||||
/* Shufflin' stuff.
|
||||
/* Revision 1.3 1997/09/05 14:17:26 curt
|
||||
/* More tweaking with stars.
|
||||
/*
|
||||
* Revision 1.2 1997/09/04 02:17:30 curt
|
||||
* Shufflin' stuff.
|
||||
*
|
||||
* Revision 1.1 1997/08/29 18:03:22 curt
|
||||
* Initial revision.
|
||||
*
|
||||
|
|
|
@ -154,7 +154,7 @@ static void fgUpdateViewParams() {
|
|||
/* Tell GL we are about to modify the projection parameters */
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(100.0, 1.0/win_ratio, 1.0, 200000.0);
|
||||
gluPerspective(60.0, 1.0/win_ratio, 1.0, 200000.0);
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
@ -555,9 +555,12 @@ int main( int argc, char *argv[] ) {
|
|||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.14 1997/09/05 01:35:53 curt
|
||||
/* Working on getting stars right.
|
||||
/* Revision 1.15 1997/09/05 14:17:27 curt
|
||||
/* More tweaking with stars.
|
||||
/*
|
||||
* Revision 1.14 1997/09/05 01:35:53 curt
|
||||
* Working on getting stars right.
|
||||
*
|
||||
* Revision 1.13 1997/09/04 02:17:34 curt
|
||||
* Shufflin' stuff.
|
||||
*
|
||||
|
|
|
@ -103,6 +103,11 @@ void fgInitSubsystems( void ) {
|
|||
/* FG_Longitude = ( -398673.28 / 3600.0 ) * DEG_TO_RAD; */
|
||||
/* FG_Altitude = 0.0 + 3.758099; */
|
||||
|
||||
/* Initial Position: 10125 Jewell St. NE */
|
||||
/* FG_Latitude = ( 45.15 ) * DEG_TO_RAD; */
|
||||
/* FG_Longitude = ( -93.15 ) * DEG_TO_RAD; */
|
||||
/* FG_Altitude = FG_Runway_altitude + 3.758099; */
|
||||
|
||||
printf("Initial position is: (%.4f, %.4f, %.2f)\n",
|
||||
FG_Latitude * RAD_TO_DEG, FG_Longitude * RAD_TO_DEG,
|
||||
FG_Altitude * FEET_TO_METER);
|
||||
|
@ -200,9 +205,12 @@ void fgInitSubsystems( void ) {
|
|||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.5 1997/09/04 02:17:36 curt
|
||||
/* Shufflin' stuff.
|
||||
/* Revision 1.6 1997/09/05 14:17:30 curt
|
||||
/* More tweaking with stars.
|
||||
/*
|
||||
* Revision 1.5 1997/09/04 02:17:36 curt
|
||||
* Shufflin' stuff.
|
||||
*
|
||||
* Revision 1.4 1997/08/27 21:32:26 curt
|
||||
* Restructured view calculation code. Added stars.
|
||||
*
|
||||
|
|
|
@ -80,7 +80,7 @@ void fgSceneryUpdate(double lon, double lat, double elev) {
|
|||
/* Render out the current scene */
|
||||
void fgSceneryRender() {
|
||||
glPushMatrix();
|
||||
/* glCallList(mesh_hack); */
|
||||
glCallList(mesh_hack);
|
||||
glPopMatrix();
|
||||
|
||||
fgStarsRender();
|
||||
|
@ -88,9 +88,12 @@ void fgSceneryRender() {
|
|||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.18 1997/09/05 01:35:59 curt
|
||||
/* Working on getting stars right.
|
||||
/* Revision 1.19 1997/09/05 14:17:30 curt
|
||||
/* More tweaking with stars.
|
||||
/*
|
||||
* Revision 1.18 1997/09/05 01:35:59 curt
|
||||
* Working on getting stars right.
|
||||
*
|
||||
* Revision 1.17 1997/08/29 17:55:27 curt
|
||||
* Worked on properly aligning the stars.
|
||||
*
|
||||
|
|
|
@ -62,7 +62,6 @@ void fgStarsInit() {
|
|||
double ra_save, decl_save;
|
||||
double ra_save1, decl_save1;
|
||||
double ra_save2, decl_save2;
|
||||
GLfloat mag[4] = {0.0, 0.0, 0.0, 1.0};
|
||||
int count;
|
||||
|
||||
g = &general;
|
||||
|
@ -118,31 +117,32 @@ void fgStarsInit() {
|
|||
sscanf(front, "%lf,%lf,%lf\n",
|
||||
&right_ascension, &declination, &magnitude);
|
||||
|
||||
if ( strcmp(name, "Deneb") == 0 ) {
|
||||
if ( strcmp(name, "Merak") == 0 ) {
|
||||
printf("\n*** Marking %s\n\n", name);
|
||||
ra_save = right_ascension;
|
||||
decl_save = declination;
|
||||
}
|
||||
|
||||
if ( strcmp(name, "Alderamin") == 0 ) {
|
||||
if ( strcmp(name, "Rastaban") == 0 ) {
|
||||
printf("\n*** Marking %s\n\n", name);
|
||||
ra_save1 = right_ascension;
|
||||
decl_save1 = declination;
|
||||
}
|
||||
|
||||
/* scale magnitudes to (0.0 - 1.0) */
|
||||
magnitude = (-1.46 - magnitude) / 10.0 + 1.0;
|
||||
magnitude = (0.0 - magnitude) / 5.0 + 1.0;
|
||||
|
||||
/* scale magnitudes again so they look ok */
|
||||
if ( magnitude > 1.0 ) { magnitude = 1.0; }
|
||||
if ( magnitude < 0.0 ) { magnitude = 0.0; }
|
||||
magnitude = magnitude * 0.8 + 0.2;
|
||||
mag[0] = mag[1] = mag[2] = magnitude;
|
||||
|
||||
printf("Found star: %d %s, %.3f %.3f %.3f\n", count,
|
||||
name, right_ascension, declination, magnitude);
|
||||
|
||||
glColor3f( mag[0], mag[1], mag[2] );
|
||||
glColor3f( magnitude, magnitude, magnitude );
|
||||
glVertex3f( 190000.0 * sin(right_ascension) * cos(declination),
|
||||
190000.0 * cos(right_ascension) * cos(declination),
|
||||
-190000.0 * cos(right_ascension) * cos(declination),
|
||||
190000.0 * sin(declination) );
|
||||
|
||||
count++;
|
||||
|
@ -157,32 +157,32 @@ void fgStarsInit() {
|
|||
glBegin(GL_LINE_LOOP);
|
||||
glColor3f(1.0, 0.0, 0.0);
|
||||
glVertex3f( 190000.0 * sin(ra_save-0.2) * cos(decl_save-0.2),
|
||||
190000.0 * cos(ra_save-0.2) * cos(decl_save-0.2),
|
||||
-190000.0 * cos(ra_save-0.2) * cos(decl_save-0.2),
|
||||
190000.0 * sin(decl_save-0.2) );
|
||||
glVertex3f( 190000.0 * sin(ra_save+0.2) * cos(decl_save-0.2),
|
||||
190000.0 * cos(ra_save+0.2) * cos(decl_save-0.2),
|
||||
-190000.0 * cos(ra_save+0.2) * cos(decl_save-0.2),
|
||||
190000.0 * sin(decl_save-0.2) );
|
||||
glVertex3f( 190000.0 * sin(ra_save+0.2) * cos(decl_save+0.2),
|
||||
190000.0 * cos(ra_save+0.2) * cos(decl_save+0.2),
|
||||
-190000.0 * cos(ra_save+0.2) * cos(decl_save+0.2),
|
||||
190000.0 * sin(decl_save+0.2) );
|
||||
glVertex3f( 190000.0 * sin(ra_save-0.2) * cos(decl_save+0.2),
|
||||
190000.0 * cos(ra_save-0.2) * cos(decl_save+0.2),
|
||||
-190000.0 * cos(ra_save-0.2) * cos(decl_save+0.2),
|
||||
190000.0 * sin(decl_save+0.2) );
|
||||
glEnd();
|
||||
|
||||
glBegin(GL_LINE_LOOP);
|
||||
glColor3f(0.0, 1.0, 0.0);
|
||||
glVertex3f( 190000.0 * sin(ra_save1-0.2) * cos(decl_save1-0.2),
|
||||
190000.0 * cos(ra_save1-0.2) * cos(decl_save1-0.2),
|
||||
-190000.0 * cos(ra_save1-0.2) * cos(decl_save1-0.2),
|
||||
190000.0 * sin(decl_save1-0.2) );
|
||||
glVertex3f( 190000.0 * sin(ra_save1+0.2) * cos(decl_save1-0.2),
|
||||
190000.0 * cos(ra_save1+0.2) * cos(decl_save1-0.2),
|
||||
-190000.0 * cos(ra_save1+0.2) * cos(decl_save1-0.2),
|
||||
190000.0 * sin(decl_save1-0.2) );
|
||||
glVertex3f( 190000.0 * sin(ra_save1+0.2) * cos(decl_save1+0.2),
|
||||
190000.0 * cos(ra_save1+0.2) * cos(decl_save1+0.2),
|
||||
-190000.0 * cos(ra_save1+0.2) * cos(decl_save1+0.2),
|
||||
190000.0 * sin(decl_save1+0.2) );
|
||||
glVertex3f( 190000.0 * sin(ra_save1-0.2) * cos(decl_save1+0.2),
|
||||
190000.0 * cos(ra_save1-0.2) * cos(decl_save1+0.2),
|
||||
-190000.0 * cos(ra_save1-0.2) * cos(decl_save1+0.2),
|
||||
190000.0 * sin(decl_save1+0.2) );
|
||||
glEnd();
|
||||
|
||||
|
@ -195,6 +195,7 @@ void fgStarsRender() {
|
|||
struct FLIGHT *f;
|
||||
struct VIEW *v;
|
||||
double angle;
|
||||
static double warp = 0;
|
||||
|
||||
f = ¤t_aircraft.flight;
|
||||
v = ¤t_view;
|
||||
|
@ -208,8 +209,11 @@ void fgStarsRender() {
|
|||
glTranslatef( v->view_pos.x, v->view_pos.y, v->view_pos.z );
|
||||
|
||||
angle = FG_2PI * fmod(DaysSinceEpoch(time(NULL)), 1.0);
|
||||
glRotatef( -angle * RAD_TO_DEG, 0.0, 0.0, 1.0 );
|
||||
printf("Rotating stars by %.2f\n", -angle * RAD_TO_DEG);
|
||||
warp += 0.5 * DEG_TO_RAD;
|
||||
warp = 240.0 * DEG_TO_RAD;
|
||||
glRotatef( -(angle+warp) * RAD_TO_DEG, 0.0, 0.0, 1.0 );
|
||||
printf("Rotating stars by %.2f + %.2f\n", -angle * RAD_TO_DEG,
|
||||
warp * RAD_TO_DEG);
|
||||
|
||||
glCallList(stars);
|
||||
|
||||
|
@ -220,9 +224,12 @@ void fgStarsRender() {
|
|||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.5 1997/09/05 01:35:59 curt
|
||||
/* Working on getting stars right.
|
||||
/* Revision 1.6 1997/09/05 14:17:31 curt
|
||||
/* More tweaking with stars.
|
||||
/*
|
||||
* Revision 1.5 1997/09/05 01:35:59 curt
|
||||
* Working on getting stars right.
|
||||
*
|
||||
* Revision 1.4 1997/09/04 02:17:38 curt
|
||||
* Shufflin' stuff.
|
||||
*
|
||||
|
|
|
@ -270,8 +270,7 @@ void fgUpdateSunPos(struct fgCartesianPoint scenery_center) {
|
|||
t = &cur_time_params;
|
||||
v = ¤t_view;
|
||||
|
||||
time_warp += 200; /* increase this to make the world spin real fast */
|
||||
time_warp = 3600*10; /* increase this to make the world spin real fast */
|
||||
time_warp += 0; /* increase this to make the world spin real fast */
|
||||
|
||||
fgSunPosition(time(NULL) + time_warp, &t->sun_lon, &sun_gd_lat);
|
||||
|
||||
|
@ -304,9 +303,12 @@ void fgUpdateSunPos(struct fgCartesianPoint scenery_center) {
|
|||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.8 1997/09/05 01:36:04 curt
|
||||
/* Working on getting stars right.
|
||||
/* Revision 1.9 1997/09/05 14:17:31 curt
|
||||
/* More tweaking with stars.
|
||||
/*
|
||||
* Revision 1.8 1997/09/05 01:36:04 curt
|
||||
* Working on getting stars right.
|
||||
*
|
||||
* Revision 1.7 1997/09/04 02:17:40 curt
|
||||
* Shufflin' stuff.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue