Worked on properly aligning the stars.
This commit is contained in:
parent
7c5f7fdc85
commit
114d08ebd0
3 changed files with 34 additions and 20 deletions
|
@ -50,7 +50,7 @@ struct SCENERY scenery;
|
||||||
/* Initialize the Scenery Management system */
|
/* Initialize the Scenery Management system */
|
||||||
void fgSceneryInit() {
|
void fgSceneryInit() {
|
||||||
/* set the default terrain detail level */
|
/* set the default terrain detail level */
|
||||||
scenery.terrain_skip = 2;
|
scenery.terrain_skip = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,9 +88,12 @@ void fgSceneryRender() {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.16 1997/08/27 21:32:29 curt
|
/* Revision 1.17 1997/08/29 17:55:27 curt
|
||||||
/* Restructured view calculation code. Added stars.
|
/* Worked on properly aligning the stars.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.16 1997/08/27 21:32:29 curt
|
||||||
|
* Restructured view calculation code. Added stars.
|
||||||
|
*
|
||||||
* Revision 1.15 1997/08/27 03:30:32 curt
|
* Revision 1.15 1997/08/27 03:30:32 curt
|
||||||
* Changed naming scheme of basic shared structures.
|
* Changed naming scheme of basic shared structures.
|
||||||
*
|
*
|
||||||
|
|
|
@ -31,14 +31,21 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
|
|
||||||
#include "stars.h"
|
#include "stars.h"
|
||||||
|
|
||||||
|
#include "../constants.h"
|
||||||
#include "../general.h"
|
#include "../general.h"
|
||||||
|
|
||||||
#include "../GLUT/views.h"
|
#include "../GLUT/views.h"
|
||||||
|
#include "../Aircraft/aircraft.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define EpochStart (631065600)
|
||||||
|
#define DaysSinceEpoch(secs) (((secs)-EpochStart)*(1.0/(24*3600)))
|
||||||
|
|
||||||
|
|
||||||
static GLint stars;
|
static GLint stars;
|
||||||
|
@ -97,7 +104,7 @@ void fgStarsInit() {
|
||||||
count++;
|
count++;
|
||||||
magnitude = magnitude * 0.8 + 0.2;
|
magnitude = magnitude * 0.8 + 0.2;
|
||||||
mag[0] = mag[1] = mag[2] = magnitude;
|
mag[0] = mag[1] = mag[2] = magnitude;
|
||||||
glColor3f( magnitude, magnitude, magnitude );
|
glColor3f( mag[0], mag[1], mag[2] );
|
||||||
glVertex3f( 190000.0 * sin(right_ascension) * cos(declination),
|
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) );
|
190000.0 * sin(declination) );
|
||||||
|
@ -113,9 +120,11 @@ void fgStarsInit() {
|
||||||
|
|
||||||
/* Draw the Stars */
|
/* Draw the Stars */
|
||||||
void fgStarsRender() {
|
void fgStarsRender() {
|
||||||
|
struct FLIGHT *f;
|
||||||
struct VIEW *v;
|
struct VIEW *v;
|
||||||
GLfloat amb[3], diff[3];
|
double angle;
|
||||||
|
|
||||||
|
f = ¤t_aircraft.flight;
|
||||||
v = ¤t_view;
|
v = ¤t_view;
|
||||||
|
|
||||||
printf("RENDERING STARS\n");
|
printf("RENDERING STARS\n");
|
||||||
|
@ -130,7 +139,11 @@ void fgStarsRender() {
|
||||||
glLightfv(GL_LIGHT0, GL_AMBIENT, amb );
|
glLightfv(GL_LIGHT0, GL_AMBIENT, amb );
|
||||||
glLightfv(GL_LIGHT0, GL_DIFFUSE, diff ); */
|
glLightfv(GL_LIGHT0, GL_DIFFUSE, diff ); */
|
||||||
|
|
||||||
glTranslatef(v->view_pos.x, v->view_pos.y, v->view_pos.z);
|
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);
|
||||||
|
|
||||||
glCallList(stars);
|
glCallList(stars);
|
||||||
|
|
||||||
|
@ -141,10 +154,13 @@ void fgStarsRender() {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.2 1997/08/27 21:32:30 curt
|
/* Revision 1.3 1997/08/29 17:55:28 curt
|
||||||
/* Restructured view calculation code. Added stars.
|
/* Worked on properly aligning the stars.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.2 1997/08/27 21:32:30 curt
|
||||||
|
* Restructured view calculation code. Added stars.
|
||||||
|
*
|
||||||
* Revision 1.1 1997/08/27 03:34:48 curt
|
* Revision 1.1 1997/08/27 03:34:48 curt
|
||||||
* Initial revisio.
|
* Initial revision.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -31,14 +31,6 @@
|
||||||
#define FG_MAX_STARS 1000
|
#define FG_MAX_STARS 1000
|
||||||
|
|
||||||
|
|
||||||
/* Define a structure containing star information */
|
|
||||||
/* struct STAR {
|
|
||||||
double right_ascension;
|
|
||||||
double declination;
|
|
||||||
double magnitude;
|
|
||||||
}; */
|
|
||||||
|
|
||||||
|
|
||||||
/* Initialize the Star Management Subsystem */
|
/* Initialize the Star Management Subsystem */
|
||||||
void fgStarsInit();
|
void fgStarsInit();
|
||||||
|
|
||||||
|
@ -50,10 +42,13 @@ void fgStarsRender();
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.2 1997/08/27 21:32:30 curt
|
/* Revision 1.3 1997/08/29 17:55:28 curt
|
||||||
/* Restructured view calculation code. Added stars.
|
/* Worked on properly aligning the stars.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.2 1997/08/27 21:32:30 curt
|
||||||
|
* Restructured view calculation code. Added stars.
|
||||||
|
*
|
||||||
* Revision 1.1 1997/08/27 03:34:50 curt
|
* Revision 1.1 1997/08/27 03:34:50 curt
|
||||||
* Initial revisio.
|
* Initial revision.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue