From: curt Date: Tue, 28 Apr 1998 01:21:42 +0000 (+0000) Subject: Tweaked texture parameter calculations to keep the number smaller. This X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=96525339ed6c3cb2a765b087f3bb4293321f05d3;p=flightgear.git Tweaked texture parameter calculations to keep the number smaller. This avoids the "swimming" problem. Type-ified fgTIME and fgVIEW. --- diff --git a/Scenery/obj.c b/Scenery/obj.c index 3a52b6cb4..d9283a228 100644 --- a/Scenery/obj.c +++ b/Scenery/obj.c @@ -74,7 +74,9 @@ void calc_normal(double p1[3], double p2[3], double p3[3], double normal[3]) 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; @@ -84,7 +86,10 @@ float calc_lon(double x, double y, double z) { 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; @@ -472,9 +477,14 @@ GLint fgObjLoad(char *path, struct fgCartesianPoint *ref, double *radius) { /* $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 diff --git a/Scenery/tilecache.cxx b/Scenery/tilecache.cxx index 45e4d0437..d621bd4f3 100644 --- a/Scenery/tilecache.cxx +++ b/Scenery/tilecache.cxx @@ -144,7 +144,7 @@ void fgTileCacheEntryInfo( int index, GLint *display_list, /* 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; @@ -200,9 +200,14 @@ int fgTileCacheNextAvail( void ) { /* $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 " in "#ifdef HAVE_CONFIG_H" * Tweaked the scenery file extentions to be "file.obj" (uncompressed)