commit 085d4e11dab42b020ad94d1e3e349b7ffdd42d75
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Tue Dec 18 20:11:16 2018 +0000

    Sphere: map the texture a bit better around the seam and the poles.

diff --git a/src/main/java/org/distorted/library/mesh/MeshSphere.java b/src/main/java/org/distorted/library/mesh/MeshSphere.java
index 0f2fe5c..3302419 100644
--- a/src/main/java/org/distorted/library/mesh/MeshSphere.java
+++ b/src/main/java/org/distorted/library/mesh/MeshSphere.java
@@ -184,7 +184,7 @@ public class MeshSphere extends MeshBase
       }
     else                      // polar triangle
       {
-      quotZ = (quotY==1.0 ? 0.0 : quotX / (1.0-quotY));
+      quotZ = (quotY==1.0 ? 0.5 : quotX / (1.0-quotY));
       }
 
     double longitude = midLongitude(lonV1, lonV2, quotZ );
@@ -232,7 +232,7 @@ public class MeshSphere extends MeshBase
     // Solution: each such 'jump' triangle, if it is the last in a row, should have the texX of its
     // last (and maybe forelast as well) vertex remapped to 1.0.
     // If such triangle is not the last in its row, we need to add two extra vertices between it and
-    // the next one, remap the old ones' texX to 1.0, and set the two new ones' texX to 0.0.
+    // the next one, remap the old ones' texX to 1.0, and set one of the two new ones' texX to 0.0.
     ////////////////////////////////////////////////////////////////////////////////////////////////
 
     if( currentVert>=3 )
@@ -256,7 +256,7 @@ public class MeshSphere extends MeshBase
             }
           else
             {
-            if( latitude> -A )  // top two triangles being corrected
+            if( latitude> -A )  // one of the top two triangles being corrected
               {
               if (2*column+row-1 == level)  // last such triangle in a row; have to introduce extra 2 vertices.
                 {
@@ -268,7 +268,6 @@ public class MeshSphere extends MeshBase
                 repeatVertex(attribs, 2);
                 repeatVertex(attribs, 2);
 
-                attribs[VERT_ATTRIBS*(currentVert-1) + TEX_ATTRIB] = 0.0f;
                 attribs[VERT_ATTRIBS*(currentVert-2) + TEX_ATTRIB] = 0.0f;
                 attribs[VERT_ATTRIBS*(currentVert-3) + TEX_ATTRIB] = 1.0f;
 
