commit 0ec011a7515ad719b2f7023b9273daf86d55b616
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Tue Apr 2 23:35:36 2019 +0100

    Fix the PINCH effect in the Earth App.

diff --git a/src/main/java/org/distorted/examples/earth/EarthRenderer.java b/src/main/java/org/distorted/examples/earth/EarthRenderer.java
index 8842de4..2c5a532 100644
--- a/src/main/java/org/distorted/examples/earth/EarthRenderer.java
+++ b/src/main/java/org/distorted/examples/earth/EarthRenderer.java
@@ -201,7 +201,7 @@ class EarthRenderer implements GLSurfaceView.Renderer
       double cosLAT = Math.cos(latitude);
 
       float x = (float)(sinLON*cosLAT)/2.0f;
-      float y = (float)       -sinLAT /2.0f;
+      float y = (float)        sinLAT /2.0f;
       float z = (float)(cosLON*cosLAT)/2.0f;
 
       Static3D center = new Static3D( (0.5f+x)*mObjWidth, (0.5f+y)*mObjHeight, (0.5f+z)*mObjDepth);
@@ -213,8 +213,12 @@ class EarthRenderer implements GLSurfaceView.Renderer
         case DEFORM           : vector = new Static3D( +x*mObjWidth/CORR, +y*mObjHeight/CORR, +z*mObjDepth/CORR);
                                 effect = new VertexEffectDeform (   vector, center, mRegionV); break;
         case SINK             : effect = new VertexEffectSink   (mStrength, center, mRegionV); break;
-        case PINCH            : mPinch.set2(latitude);//>0 ? (float)(Math.PI/2 - latitude) : (float)(-Math.PI/2 - latitude) );
-                                mPinch.set3(longitude);// (float)(Math.PI+longitude) );
+        case PINCH            : float lat = latitude>0 ? (float)(-Math.PI/2 + latitude) : (float)(Math.PI/2 + latitude);
+                                float lon = longitude;
+                                float latInDegrees = (float)(lat*180.0f/Math.PI);
+                                float lonInDegrees = (float)(lon*180.0f/Math.PI);
+                                mPinch.set2(latInDegrees);
+                                mPinch.set3(lonInDegrees);
                                 effect = new VertexEffectPinch  (mPinch   , center, mRegionV); break;
         case SWIRL            : effect = new VertexEffectSwirl  (mSwirl   , center, mRegionV); break;      // SWIRL & WAVE are not really fully
         case WAVE             : Static5D wave = new Static5D( RADIUS_V/2, RADIUS_V/2, 0, 90-latitude, 90); // 3D effects. They will not look
diff --git a/src/main/java/org/distorted/examples/earth/EarthSurfaceViewPicker.java b/src/main/java/org/distorted/examples/earth/EarthSurfaceViewPicker.java
index b430abc..4655145 100644
--- a/src/main/java/org/distorted/examples/earth/EarthSurfaceViewPicker.java
+++ b/src/main/java/org/distorted/examples/earth/EarthSurfaceViewPicker.java
@@ -196,7 +196,7 @@ class EarthSurfaceViewPicker extends SurfaceView implements SurfaceHolder.Callba
       mPointsE.add(mCurrentEffect.ordinal());
 
       float longitude = (float)((xf-0.5f)*2.0f*Math.PI);
-      float latitude  = (float)((yf-0.5f)*Math.PI);
+      float latitude  = (float)((0.5f-yf)     *Math.PI);
 
       mAct.get().addNewPoint(longitude,latitude,mCurrentEffect);
       }
