float calc_lon(double x, double y, double z) {
float tmp;
- tmp = (RAD_TO_DEG*atan2(y, x)) * FG_TEX_CONSTANT;
+ tmp = fmod(
+ (RAD_TO_DEG*atan2(y, x)) * FG_TEX_CONSTANT,
+ 10.0);
// printf("lon = %.2f\n", (float)tmp);
return (float)tmp;
float calc_lat(double x, double y, double z) {
float tmp;
- tmp = (90.0 - RAD_TO_DEG*atan2( sqrt(x*x + y*y), z )) * FG_TEX_CONSTANT;
+ tmp = fmod(
+ (90.0 - RAD_TO_DEG *
+ atan2( sqrt(x*x + y*y), z )) * FG_TEX_CONSTANT,
+ 10.0);
// printf("lat = %.2f\n", (float)tmp);
return (float)tmp;
/* $Log$
-/* Revision 1.33 1998/04/27 15:58:15 curt
-/* Screwing around with texture coordinate generation ... still needs work.
+/* Revision 1.34 1998/04/28 01:21:42 curt
+/* Tweaked texture parameter calculations to keep the number smaller. This
+/* avoids the "swimming" problem.
+/* Type-ified fgTIME and fgVIEW.
/*
+ * Revision 1.33 1998/04/27 15:58:15 curt
+ * Screwing around with texture coordinate generation ... still needs work.
+ *
* Revision 1.32 1998/04/27 03:30:13 curt
* Minor transformation adjustments to try to keep scenery tiles closer to
* (0, 0, 0) GLfloats run out of precision at the distances we need to model
/* Return index of next available slot in tile cache */
int fgTileCacheNextAvail( void ) {
- struct fgVIEW *v;
+ fgVIEW *v;
int i;
float dx, dy, dz, max, med, min, tmp;
float dist, max_dist;
/* $Log$
-/* Revision 1.3 1998/04/25 22:06:32 curt
-/* Edited cvs log messages in source files ... bad bad bad!
+/* Revision 1.4 1998/04/28 01:21:43 curt
+/* Tweaked texture parameter calculations to keep the number smaller. This
+/* avoids the "swimming" problem.
+/* Type-ified fgTIME and fgVIEW.
/*
+ * Revision 1.3 1998/04/25 22:06:32 curt
+ * Edited cvs log messages in source files ... bad bad bad!
+ *
* Revision 1.2 1998/04/24 00:51:08 curt
* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
* Tweaked the scenery file extentions to be "file.obj" (uncompressed)