commit 1da3c7db93139a9affc1e7f39cf3ded54da7dc16
Author: leszek <leszek@koltunski.pl>
Date:   Wed Apr 26 00:07:03 2017 +0100

    Revert "One more APP converted. Only 2 remain."
    
    This reverts commit 00d86f0fc5d827d8d6d30db9a69f18df56d63428.

diff --git a/src/main/java/org/distorted/examples/matrix3d/Matrix3DEffect.java b/src/main/java/org/distorted/examples/matrix3d/Matrix3DEffect.java
index d7fc204..d126cde 100644
--- a/src/main/java/org/distorted/examples/matrix3d/Matrix3DEffect.java
+++ b/src/main/java/org/distorted/examples/matrix3d/Matrix3DEffect.java
@@ -131,24 +131,16 @@ class Matrix3DEffect implements SeekBar.OnSeekBarChangeListener
                               float sinAnorm = (float)Math.sin(qa/2)/len;
                               mSta4.set(sinAnorm*qx,sinAnorm*qy,sinAnorm*qz, cosA);
                               break;
-      case MOVE             : float s  = 0.04f;
-                              float xm = (mInter[0]-50)*s;
-                              float ym = (mInter[1]-50)*s;
-                              float zm = (mInter[2]-50)*s;
+      case MOVE             : float sw = mAct.get().getScreenWidth()/50.0f;
+                              float sh = mAct.get().getScreenWidth()/50.0f;
+                              float xm = (mInter[0]-50)*sw;
+                              float ym = (mInter[1]-50)*sh;
+                              float zm = (mInter[2]-50)*(sw+sh)/2;
                               mSta3.set(xm,ym,zm);
                               break;
-      case SCALE            : double coeff = Math.PI / 100;
-
-                              if( mInter[0]<=  0 ) mInter[0]= 1;
-                              if( mInter[0]>=100 ) mInter[0]=99;
-                              if( mInter[1]<=  0 ) mInter[1]= 1;
-                              if( mInter[1]>=100 ) mInter[1]=99;
-                              if( mInter[2]<=  0 ) mInter[2]= 1;
-                              if( mInter[2]>=100 ) mInter[2]=99;
-
-                              float xs = (float)Math.tan((mInter[0]-50)*coeff);
-                              float ys = (float)Math.tan((mInter[1]-50)*coeff);
-                              float zs = (float)Math.tan((mInter[2]-50)*coeff);
+      case SCALE            : float xs = (mInter[0]-50)/10.0f;
+                              float ys = (mInter[1]-50)/10.0f;
+                              float zs = (mInter[2]-50)/10.0f;
                               mSta3.set(xs,ys,zs);
                               break;
       case SHEAR            : float xsh = (mInter[0]-50)/25.0f;
@@ -219,9 +211,9 @@ class Matrix3DEffect implements SeekBar.OnSeekBarChangeListener
       }
     if( mName==EffectNames.SCALE )
       {
-      mInter[0]= 75;
-      mInter[1]= 75;
-      mInter[2]= 75;
+      mInter[0]= 60;
+      mInter[1]= 60;
+      mInter[2]= 60;
       }
     }
 
@@ -278,9 +270,11 @@ class Matrix3DEffect implements SeekBar.OnSeekBarChangeListener
 
   private void fillCenterStatics()
     {
-    float x = (mInterCenter[0]-50)*0.02f;
-    float y = (mInterCenter[1]-50)*0.02f;
-    float z = (mInterCenter[2]-50)*0.02f;
+    Matrix3DActivity act = mAct.get();
+
+    float x = (mInterCenter[0]*0.012f - 0.1f)*act.getWidth();
+    float y = (mInterCenter[1]*0.012f - 0.1f)*act.getHeight();
+    float z = (mInterCenter[2]*0.012f - 0.1f)*act.getDepth();
 
     mCenterSta.set(x,y,z);
     }
@@ -298,9 +292,9 @@ class Matrix3DEffect implements SeekBar.OnSeekBarChangeListener
 
   private void setCenterText()
     {
-    float f0 = ((int)(mCenterSta.getX()*100))/100.0f;
-    float f1 = ((int)(mCenterSta.getY()*100))/100.0f;
-    float f2 = ((int)(mCenterSta.getZ()*100))/100.0f;
+    int f0 = (int)mCenterSta.getX();
+    int f1 = (int)mCenterSta.getY();
+    int f2 = (int)mCenterSta.getZ();
 
     mTextCenter.setText("center ("+f0+","+f1+","+f2+")");
     }
