../Scenery/scenery.h ../Scenery/../types.h ../Math/mat3.h \
../Math/polar.h ../Math/../types.h ../Time/fg_timer.h \
../Math/fg_random.h ../Weather/weather.h
+test.o: test.c test.h ../Aircraft/aircraft.h \
+ ../Aircraft/../Flight/flight.h ../Aircraft/../Flight/Slew/slew.h \
+ ../Aircraft/../Flight/LaRCsim/ls_interface.h \
+ ../Aircraft/../Flight/LaRCsim/../flight.h \
+ ../Aircraft/../Controls/controls.h \
+ ../Aircraft/../Controls/../limits.h ../Flight/flight.h \
+ ../Controls/controls.h ../constants.h ../Scenery/mesh.h \
+ ../Scenery/scenery.h ../Scenery/../types.h ../Math/mat3.h \
+ ../Math/polar.h ../Math/../types.h ../Time/fg_timer.h \
+ ../Math/fg_random.h ../Weather/weather.h
struct VIEW *v;
double x_2, x_4, x_8, x_10;
double ambient, diffuse, sky;
- GLfloat color[4] = { 1.0, 1.0, 0.50, 1.0 };
+ /* GLfloat color[4] = { 1.0, 1.0, 0.50, 1.0 };*/
+ GLfloat color[4] = { 1.0, 0.0, 0.00, 1.0 };
GLfloat amb[3], diff[3], fog[4], clear[4];
f = ¤t_aircraft.flight;
/* $Log$
-/* Revision 1.21 1997/09/23 00:29:38 curt
-/* Tweaks to get things to compile with gcc-win32.
+/* Revision 1.22 1997/10/30 12:38:41 curt
+/* Working on new scenery subsystem.
/*
+ * Revision 1.21 1997/09/23 00:29:38 curt
+ * Tweaks to get things to compile with gcc-win32.
+ *
* Revision 1.20 1997/09/22 14:44:19 curt
* Continuing to try to align stars correctly.
*
FG_Longitude = ( -398391.28 / 3600.0 ) * DEG_TO_RAD;
FG_Latitude = ( 120070.41 / 3600.0 ) * DEG_TO_RAD;
FG_Altitude = FG_Runway_altitude + 3.758099;
- /* FG_Altitude = 20000; */
+ FG_Altitude = 20000;
/* Initial Position north of the city of Globe */
/* FG_Longitude = ( -398673.28 / 3600.0 ) * DEG_TO_RAD; */
/* $Log$
-/* Revision 1.10 1997/10/25 03:24:23 curt
-/* Incorporated sun, moon, and star positioning code contributed by Durk Talsma.
+/* Revision 1.11 1997/10/30 12:38:42 curt
+/* Working on new scenery subsystem.
/*
+ * Revision 1.10 1997/10/25 03:24:23 curt
+ * Incorporated sun, moon, and star positioning code contributed by Durk Talsma.
+ *
* Revision 1.9 1997/09/23 00:29:39 curt
* Tweaks to get things to compile with gcc-win32.
*
../Time/../Flight/LaRCsim/../flight.h moon.h ../Main/views.h \
../Main/../types.h ../Main/../Flight/flight.h ../Main/../Math/mat3.h \
../general.h
-obj.o: obj.c obj.h
+obj.o: obj.c obj.h scenery.h ../types.h ../constants.h \
+ ../Math/fg_geodesy.h ../Math/polar.h ../Math/../types.h
orbits.o: orbits.c orbits.h ../Time/fg_time.h ../Time/../types.h \
../Time/../Flight/flight.h ../Time/../Flight/Slew/slew.h \
../Time/../Flight/LaRCsim/ls_interface.h \
GLint mesh_to_OpenGL(struct MESH *m) {
GLint mesh;
/* static GLfloat color[4] = { 0.5, 0.4, 0.25, 1.0 }; */ /* dark desert */
- static GLfloat color[4] = { 0.5, 0.5, 0.25, 1.0 };
+ /* static GLfloat color[4] = { 0.5, 0.5, 0.25, 1.0 }; */
+ static GLfloat color[4] = { 1.0, 0.0, 0.0, 1.0 };
double centerx, centery;
double randx, randy;
/* $Log$
-/* Revision 1.22 1997/10/28 21:00:21 curt
-/* Changing to new terrain format.
+/* Revision 1.23 1997/10/30 12:38:44 curt
+/* Working on new scenery subsystem.
/*
+ * Revision 1.22 1997/10/28 21:00:21 curt
+ * Changing to new terrain format.
+ *
* Revision 1.21 1997/08/27 03:30:27 curt
* Changed naming scheme of basic shared structures.
*
#include <GL/glut.h>
#include "obj.h"
+#include "scenery.h"
#include "../constants.h"
#include "../types.h"
struct fgCartesianPoint p;
double gc_lon, gc_lat, sl_radius;
- printf("A geodetic point is (%.2f, %.2f, %.2f)\n",
- geod[0], geod[1], geod[2]);
+ /* printf("A geodetic point is (%.2f, %.2f, %.2f)\n",
+ geod[0], geod[1], geod[2]); */
gc_lon = geod[0]*ARCSEC_TO_RAD;
fgGeodToGeoc(geod[1]*ARCSEC_TO_RAD, geod[2], &sl_radius, &gc_lat);
- printf("A geocentric point is (%.2f, %.2f, %.2f)\n", gc_lon,
- gc_lat, sl_radius+geod[2]);
+ /* printf("A geocentric point is (%.2f, %.2f, %.2f)\n", gc_lon,
+ gc_lat, sl_radius+geod[2]); */
p = fgPolarToCart(gc_lon, gc_lat, sl_radius+geod[2]);
- printf("A cart point is (%.8f, %.8f, %.8f)\n", p.x, p.y, p.z);
+ /* printf("A cart point is (%.8f, %.8f, %.8f)\n", p.x, p.y, p.z); */
return(p);
}
GLint fgObjLoad(char *path) {
char line[256];
static GLfloat color[4] = { 0.5, 0.5, 0.25, 1.0 };
- struct fgCartesianPoint p1, p2, p3;
+ struct fgCartesianPoint p1, p2, p3, p4, ref;
GLint area;
FILE *f;
- int first, ncount, n1, n2, n3;
+ int first, ncount, n1, n2, n3, n4;
if ( (f = fopen(path, "r")) == NULL ) {
printf("Cannot open file: %s\n", path);
} else if ( line[0] == 'v' ) {
/* node (vertex) */
if ( ncount < MAXNODES ) {
- printf("vertex = %s", line);
+ /* printf("vertex = %s", line); */
sscanf(line, "v %f %f %f\n",
&nodes[ncount][0], &nodes[ncount][1], &nodes[ncount][2]);
+ if ( ncount == 1 ) {
+ /* first node becomes the reference point */
+ ref = geod_to_cart(nodes[ncount]);
+ scenery.center = ref;
+ }
ncount++;
} else {
printf("Read too many nodes ... dying :-(\n");
} else if ( line[0] == 't' ) {
/* start a new triangle strip */
+ n1 = n2 = n3 = n4 = 0;
+
if ( !first ) {
/* close out the previous structure and start the next */
- first = 0;
glEnd();
glBegin(GL_TRIANGLE_STRIP);
+ } else {
+ first = 0;
}
printf("new tri strip = %s", line);
p1 = geod_to_cart(nodes[n1]);
p2 = geod_to_cart(nodes[n2]);
p3 = geod_to_cart(nodes[n3]);
+
+ glNormal3d(0.0, 0.0, -1.0);
+
+ glVertex3d(p1.x - ref.x, p1.y - ref.y, p1.z - ref.z);
+ glVertex3d(p2.x - ref.x, p2.y - ref.y, p2.z - ref.z);
+ glVertex3d(p3.x - ref.x, p3.y - ref.y, p3.z - ref.z);
+
+ if ( n4 > 0 ) {
+ p4 = geod_to_cart(nodes[n4]);
+ glVertex3d(p4.x - ref.x, p4.y - ref.y, p4.z - ref.z);
+ }
} else if ( line[0] == 'q' ) {
/* continue a triangle strip */
n1 = n2 = 0;
printf("continued tri strip = %s", line);
sscanf(line, "q %d %d\n", &n1, &n2);
printf("read %d %d\n", n1, n2);
+
+ p1 = geod_to_cart(nodes[n1]);
+ glVertex3d(p1.x - ref.x, p1.y - ref.y, p1.z - ref.z);
+
+ if ( n2 > 0 ) {
+ p2 = geod_to_cart(nodes[n2]);
+ glVertex3d(p2.x - ref.x, p2.y - ref.y, p2.z - ref.z);
+ }
} else {
printf("Unknown line in %s = %s\n", path, line);
}
/* $Log$
-/* Revision 1.1 1997/10/28 21:14:54 curt
-/* Initial revision.
+/* Revision 1.2 1997/10/30 12:38:45 curt
+/* Working on new scenery subsystem.
/*
+ * Revision 1.1 1997/10/28 21:14:54 curt
+ * Initial revision.
+ *
*/
#include "../constants.h"
#include "../general.h"
-
#include "../Aircraft/aircraft.h"
#include "../Main/views.h"
#include "../Time/fg_time.h"
/* $Log$
-/* Revision 1.14 1997/10/28 21:00:22 curt
-/* Changing to new terrain format.
+/* Revision 1.15 1997/10/30 12:38:45 curt
+/* Working on new scenery subsystem.
/*
+ * Revision 1.14 1997/10/28 21:00:22 curt
+ * Changing to new terrain format.
+ *
* Revision 1.13 1997/10/25 03:18:28 curt
* Incorporated sun, moon, and planet position and rendering code contributed
* by Durk Talsma.
SUBSUBDIRS = Flight/LaRCsim Flight/Slew
-SUBDIRS = Aircraft Cockpit Controls Flight Joystick Math Scenery \
- Time Weather
+SUBDIRS = Aircraft Cockpit Controls Flight Joystick Math Scenery Time Weather
MAIN = Main
#---------------------------------------------------------------------------
# $Log$
+# Revision 1.29 1997/10/30 12:38:35 curt
+# Working on new scenery subsystem.
+#
# Revision 1.28 1997/10/28 19:35:40 curt
# Organizational changes.
#
../Flight/Slew/slew.h ../Flight/LaRCsim/ls_interface.h \
../Flight/LaRCsim/../flight.h ../constants.h ../Time/fg_time.h
fg_timer.o: fg_timer.c fg_timer.h
-sptest.o: sptest.c sunpos.h ../types.h ../constants.h
+sidereal.o: sidereal.c ../constants.h
sunpos.o: sunpos.c sunpos.h ../types.h fg_time.h ../Flight/flight.h \
../Flight/Slew/slew.h ../Flight/LaRCsim/ls_interface.h \
../Flight/LaRCsim/../flight.h ../constants.h ../Main/views.h \