Worked on properly translating and positioning the sky dome.
This commit is contained in:
parent
9dbcf67b4c
commit
a26c9b75ee
2 changed files with 30 additions and 10 deletions
12
Main/views.c
12
Main/views.c
|
@ -52,7 +52,10 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v) {
|
||||||
|
|
||||||
/* calculate the cartesion coords of the current lat/lon/0 elev */
|
/* calculate the cartesion coords of the current lat/lon/0 elev */
|
||||||
v->cur_zero_elev = fgPolarToCart(FG_Longitude, FG_Lat_geocentric,
|
v->cur_zero_elev = fgPolarToCart(FG_Longitude, FG_Lat_geocentric,
|
||||||
FG_Sea_level_radius);
|
FG_Sea_level_radius * FEET_TO_METER);
|
||||||
|
v->cur_zero_elev.x -= scenery.center.x;
|
||||||
|
v->cur_zero_elev.y -= scenery.center.y;
|
||||||
|
v->cur_zero_elev.z -= scenery.center.z;
|
||||||
|
|
||||||
/* calculate view position in current FG view coordinate system */
|
/* calculate view position in current FG view coordinate system */
|
||||||
v->view_pos = fgPolarToCart(FG_Longitude, FG_Lat_geocentric,
|
v->view_pos = fgPolarToCart(FG_Longitude, FG_Lat_geocentric,
|
||||||
|
@ -137,9 +140,12 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.4 1997/12/17 23:13:36 curt
|
/* Revision 1.5 1997/12/18 04:07:02 curt
|
||||||
/* Began working on rendering a sky.
|
/* Worked on properly translating and positioning the sky dome.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.4 1997/12/17 23:13:36 curt
|
||||||
|
* Began working on rendering a sky.
|
||||||
|
*
|
||||||
* Revision 1.3 1997/12/15 23:54:50 curt
|
* Revision 1.3 1997/12/15 23:54:50 curt
|
||||||
* Add xgl wrappers for debugging.
|
* Add xgl wrappers for debugging.
|
||||||
* Generate terrain normals on the fly.
|
* Generate terrain normals on the fly.
|
||||||
|
|
|
@ -42,16 +42,17 @@
|
||||||
|
|
||||||
#include "../Time/fg_time.h"
|
#include "../Time/fg_time.h"
|
||||||
|
|
||||||
|
#include "../Aircraft/aircraft.h"
|
||||||
|
#include "../Flight/flight.h"
|
||||||
#include "../Include/constants.h"
|
#include "../Include/constants.h"
|
||||||
#include "../Main/views.h"
|
#include "../Main/views.h"
|
||||||
/*
|
/*
|
||||||
#include "../Include/general.h"
|
#include "../Include/general.h"
|
||||||
#include "../Aircraft/aircraft.h"
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* in meters of course */
|
/* in meters of course */
|
||||||
#define INNER_RADIUS 50000.0
|
#define INNER_RADIUS 50000.0
|
||||||
#define INNER_ELEV 20000.0
|
#define INNER_ELEV 8000.0 /* was 20000 */
|
||||||
#define MIDDLE_RADIUS 70000.0
|
#define MIDDLE_RADIUS 70000.0
|
||||||
#define MIDDLE_ELEV 10000.0
|
#define MIDDLE_ELEV 10000.0
|
||||||
#define OUTER_RADIUS 80000.0
|
#define OUTER_RADIUS 80000.0
|
||||||
|
@ -110,11 +111,14 @@ void fgSkyInit() {
|
||||||
/* Draw inner section */
|
/* Draw inner section */
|
||||||
xglBegin( GL_TRIANGLE_FAN );
|
xglBegin( GL_TRIANGLE_FAN );
|
||||||
|
|
||||||
|
xglColor3f(0.0, 0.0, 1.0);
|
||||||
xglVertex3f(0.0, 0.0, INNER_ELEV);
|
xglVertex3f(0.0, 0.0, INNER_ELEV);
|
||||||
|
|
||||||
|
xglColor3f(0.2, 0.2, 1.0);
|
||||||
for ( i = 0; i < 12; i++ ) {
|
for ( i = 0; i < 12; i++ ) {
|
||||||
xglVertex3fv( sky_center[i] );
|
xglVertex3fv( sky_center[i] );
|
||||||
}
|
}
|
||||||
|
xglVertex3fv( sky_center[0] );
|
||||||
|
|
||||||
xglEnd();
|
xglEnd();
|
||||||
|
|
||||||
|
@ -124,17 +128,17 @@ void fgSkyInit() {
|
||||||
|
|
||||||
/* Draw the Sky */
|
/* Draw the Sky */
|
||||||
void fgSkyRender() {
|
void fgSkyRender() {
|
||||||
|
struct fgFLIGHT *f;
|
||||||
struct fgVIEW *v;
|
struct fgVIEW *v;
|
||||||
/*
|
/*
|
||||||
struct fgFLIGHT *f;
|
|
||||||
struct fgLIGHT *l;
|
struct fgLIGHT *l;
|
||||||
struct fgTIME *t;
|
struct fgTIME *t;
|
||||||
int i;
|
int i;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
f = ¤t_aircraft.flight;
|
||||||
v = ¤t_view;
|
v = ¤t_view;
|
||||||
/*
|
/*
|
||||||
f = ¤t_aircraft.flight;
|
|
||||||
l = &cur_light_params;
|
l = &cur_light_params;
|
||||||
t = &cur_time_params;
|
t = &cur_time_params;
|
||||||
*/
|
*/
|
||||||
|
@ -151,6 +155,13 @@ void fgSkyRender() {
|
||||||
|
|
||||||
/* Translate to view position */
|
/* Translate to view position */
|
||||||
xglTranslatef( v->cur_zero_elev.x, v->cur_zero_elev.y, v->cur_zero_elev.z );
|
xglTranslatef( v->cur_zero_elev.x, v->cur_zero_elev.y, v->cur_zero_elev.z );
|
||||||
|
/* printf(" Translated to %.2f %.2f %.2f\n",
|
||||||
|
v->cur_zero_elev.x, v->cur_zero_elev.y, v->cur_zero_elev.z ); */
|
||||||
|
|
||||||
|
printf(" lon = %.2f lat = %.2f\n", FG_Longitude * RAD_TO_DEG,
|
||||||
|
FG_Latitude * RAD_TO_DEG);
|
||||||
|
xglRotatef( FG_Longitude * RAD_TO_DEG, 0.0, 0.0, 1.0 );
|
||||||
|
xglRotatef( 90.0 - FG_Latitude * RAD_TO_DEG, 0.0, 1.0, 0.0 );
|
||||||
|
|
||||||
xglCallList( sky );
|
xglCallList( sky );
|
||||||
|
|
||||||
|
@ -161,8 +172,11 @@ void fgSkyRender() {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.1 1997/12/17 23:14:30 curt
|
/* Revision 1.2 1997/12/18 04:07:03 curt
|
||||||
/* Initial revision.
|
/* Worked on properly translating and positioning the sky dome.
|
||||||
/* Begin work on rendering the sky. (Rather than just using a clear screen.)
|
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.1 1997/12/17 23:14:30 curt
|
||||||
|
* Initial revision.
|
||||||
|
* Begin work on rendering the sky. (Rather than just using a clear screen.)
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue