From aefbf0cc051aab5eb14dfc189893098d566cfd23 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 20 Oct 1998 18:33:55 +0000 Subject: [PATCH] Tweaked texture coordinates, but we still have some problems. :-( --- Objects/obj.cxx | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/Objects/obj.cxx b/Objects/obj.cxx index ee2652248..35973ac05 100644 --- a/Objects/obj.cxx +++ b/Objects/obj.cxx @@ -85,13 +85,17 @@ static void calc_normal(double p1[3], double p2[3], } -#define FG_TEX_CONSTANT 8.0 +#define FG_TEX_CONSTANT 69.0 // Calculate texture coordinates for a given point. static Point3D calc_tex_coords(double *node, const Point3D& ref) { Point3D cp; Point3D pp; + // double tmplon, tmplat; + + // cout << "-> " << node[0] << " " << node[1] << " " << node[2] << endl; + // cout << "-> " << ref.x() << " " << ref.y() << " " << ref.z() << endl; cp = Point3D( node[0] + ref.x(), node[1] + ref.y(), @@ -99,19 +103,23 @@ static Point3D calc_tex_coords(double *node, const Point3D& ref) { pp = fgCartToPolar3d(cp); - // cout << pp << endl; + // tmplon = pp.lon() * RAD_TO_DEG; + // tmplat = pp.lat() * RAD_TO_DEG; + // cout << tmplon << " " << tmplat << endl; - pp.setx( fmod(RAD_TO_DEG * FG_TEX_CONSTANT * pp.x(), 1.0) ); - pp.sety( fmod(RAD_TO_DEG * FG_TEX_CONSTANT * pp.y(), 1.0) ); + pp.setx( fmod(RAD_TO_DEG * FG_TEX_CONSTANT * pp.x(), 11.0) ); + pp.sety( fmod(RAD_TO_DEG * FG_TEX_CONSTANT * pp.y(), 11.0) ); if ( pp.x() < 0.0 ) { - pp.setx( pp.x() + 1.0 ); + pp.setx( pp.x() + 11.0 ); } if ( pp.y() < 0.0 ) { - pp.sety( pp.y() + 1.0 ); + pp.sety( pp.y() + 11.0 ); } + // cout << pp << endl; + return(pp); } @@ -173,15 +181,11 @@ int fgObjLoad( const string& path, fgTILE *t) { { // reference point (center offset) in.stream() >> t->center >> t->bounding_radius; + center = t->center; } else if ( token == "bs" ) { // reference point (center offset) - /* - in.stream() >> fragment.center.x - >> fragment.center.y - >> fragment.center.z - */ in.stream() >> fragment.center; in.stream() >> fragment.bounding_radius; } @@ -549,6 +553,9 @@ int fgObjLoad( const string& path, fgTILE *t) { // $Log$ +// Revision 1.8 1998/10/20 18:33:55 curt +// Tweaked texture coordinates, but we still have some problems. :-( +// // Revision 1.7 1998/10/20 15:48:44 curt // Removed an extraneous output message. // -- 2.39.2