commit 840d83be478a690032b0f1a75a7091beda9ac40b
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Thu Apr 4 16:53:18 2019 +0100

    Improve the Rubik App.

diff --git a/src/main/java/org/distorted/examples/rubik/RubikRenderer.java b/src/main/java/org/distorted/examples/rubik/RubikRenderer.java
index 600583c..5fc0327 100644
--- a/src/main/java/org/distorted/examples/rubik/RubikRenderer.java
+++ b/src/main/java/org/distorted/examples/rubik/RubikRenderer.java
@@ -46,8 +46,7 @@ import javax.microedition.khronos.opengles.GL10;
 
 class RubikRenderer implements GLSurfaceView.Renderer
 {
-            static final int NUM_CUBES =   6;
-    private static final int VERTICES  =  10;
+            static final int NUM_CUBES =   3;
     private static final int SIZE      = 200;
 
     private static final float CUBE_SCREEN_RATIO = 0.5f;
@@ -87,7 +86,9 @@ class RubikRenderer implements GLSurfaceView.Renderer
       mEffects = new DistortedEffects[NUM_CUBES][NUM_CUBES][NUM_CUBES];
       Static3D[][][] cubeVectors = new Static3D[NUM_CUBES][NUM_CUBES][NUM_CUBES];
 
-      VertexEffectSink sink = new VertexEffectSink( new Static1D(3.0f),
+      float sinkDegree = 3.0f - 1.7f/NUM_CUBES; // f(1)=1.3, f(inf)=3
+
+      VertexEffectSink sink = new VertexEffectSink( new Static1D(sinkDegree),
                                                     new Static3D(SIZE*0.5f, SIZE*0.5f, SIZE*0.5f),
                                                     new Static4D(0,0,0, SIZE*0.72f) );
       mMove  = new Static3D(0,0,0);
@@ -96,7 +97,7 @@ class RubikRenderer implements GLSurfaceView.Renderer
 
       mLastRow = mLastCol = mLastSli = 0;
 
-      mGlowRadius = new Static1D(10);
+      mGlowRadius = new Static1D(5);
       mGlowColor  = new Static4D(1.0f,1.0f,1.0f,0.6f);
 
       MatrixEffectMove       move  = new MatrixEffectMove(mMove);
@@ -125,30 +126,34 @@ class RubikRenderer implements GLSurfaceView.Renderer
       final Static4D mapBlack = new Static4D(ze,ze, ze+of,ze+of);
 
       Static4D tmpFront, tmpBack, tmpLeft, tmpRight, tmpTop, tmpBottom;
+      float nc = 0.5f*(NUM_CUBES-1);
+      int vertices = (int)(24.0f/NUM_CUBES + 2.0f);
 
       for(int x = 0; x< NUM_CUBES; x++)
         for(int y = 0; y< NUM_CUBES; y++)
           for(int z = 0; z< NUM_CUBES; z++)
             {
-            tmpLeft  = (x==            0 ? mapLeft  :mapBlack);
-            tmpRight = (x== NUM_CUBES -1 ? mapRight :mapBlack);
-            tmpFront = (z== NUM_CUBES -1 ? mapFront :mapBlack);
-            tmpBack  = (z==            0 ? mapBack  :mapBlack);
-            tmpTop   = (y== NUM_CUBES -1 ? mapTop   :mapBlack);
-            tmpBottom= (y==            0 ? mapBottom:mapBlack);
-
-            mCubes[x][y][z] = new MeshCubes(VERTICES,VERTICES,VERTICES, tmpFront, tmpBack, tmpLeft, tmpRight, tmpTop, tmpBottom);
-
-            cubeVectors[x][y][z] = new Static3D( SIZE*(x-0.5f*(NUM_CUBES -1)), SIZE*(y-0.5f*(NUM_CUBES -1)), SIZE*(z-0.5f*(NUM_CUBES -1)) );
-
-            mEffects[x][y][z] = new DistortedEffects();
-
-            mEffects[x][y][z].apply(sink);
-            mEffects[x][y][z].apply(move);
-            mEffects[x][y][z].apply(scale);
-            mEffects[x][y][z].apply(quat1);
-            mEffects[x][y][z].apply(quat2);
-            mEffects[x][y][z].apply( new MatrixEffectMove(cubeVectors[x][y][z]) );
+            if( x==0 || x==NUM_CUBES-1 || y==0 || y==NUM_CUBES-1 || z==0 || z==NUM_CUBES-1 ) // only the external walls
+              {
+              tmpLeft  = (x==            0 ? mapLeft  :mapBlack);
+              tmpRight = (x== NUM_CUBES -1 ? mapRight :mapBlack);
+              tmpFront = (z== NUM_CUBES -1 ? mapFront :mapBlack);
+              tmpBack  = (z==            0 ? mapBack  :mapBlack);
+              tmpTop   = (y== NUM_CUBES -1 ? mapTop   :mapBlack);
+              tmpBottom= (y==            0 ? mapBottom:mapBlack);
+
+              mCubes[x][y][z] = new MeshCubes(vertices,vertices,vertices, tmpFront, tmpBack, tmpLeft, tmpRight, tmpTop, tmpBottom);
+
+              cubeVectors[x][y][z] = new Static3D( SIZE*(x-nc), SIZE*(y-nc), SIZE*(z-nc) );
+
+              mEffects[x][y][z] = new DistortedEffects();
+              mEffects[x][y][z].apply(sink);
+              mEffects[x][y][z].apply(move);
+              mEffects[x][y][z].apply(scale);
+              mEffects[x][y][z].apply(quat1);
+              mEffects[x][y][z].apply(quat2);
+              mEffects[x][y][z].apply( new MatrixEffectMove(cubeVectors[x][y][z]) );
+              }
             }
       }
 
@@ -232,7 +237,10 @@ class RubikRenderer implements GLSurfaceView.Renderer
       for(int x = 0; x< NUM_CUBES; x++)
         for(int y = 0; y< NUM_CUBES; y++)
           for(int z = 0; z< NUM_CUBES; z++)
-             mScreen.attach(mTexture,mEffects[x][y][z],mCubes[x][y][z]);
+            if( x==0 || x==NUM_CUBES-1 || y==0 || y==NUM_CUBES-1 || z==0 || z==NUM_CUBES-1 ) // only the external walls
+              {
+              mScreen.attach(mTexture,mEffects[x][y][z],mCubes[x][y][z]);
+              }
 
       PostprocessEffectGlow.enable();
       VertexEffectSink.enable();
diff --git a/src/main/java/org/distorted/examples/rubik/RubikSurfaceView.java b/src/main/java/org/distorted/examples/rubik/RubikSurfaceView.java
index 701fbe3..d81eb1c 100644
--- a/src/main/java/org/distorted/examples/rubik/RubikSurfaceView.java
+++ b/src/main/java/org/distorted/examples/rubik/RubikSurfaceView.java
@@ -25,13 +25,14 @@ import android.content.pm.ConfigurationInfo;
 import android.opengl.GLSurfaceView;
 import android.view.MotionEvent;
 
+import org.distorted.library.type.Static3D;
 import org.distorted.library.type.Static4D;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 class RubikSurfaceView extends GLSurfaceView
 {
-    private final static int NONE  =-1;
+    private final static int NONE   =-1;
     private final static int FRONT  = 0;
     private final static int BACK   = 1;
     private final static int LEFT   = 2;
@@ -39,12 +40,25 @@ class RubikSurfaceView extends GLSurfaceView
     private final static int TOP    = 4;
     private final static int BOTTOM = 5;
 
-    private boolean mDragging;
+    private static final int DIR_UP   =0;
+    private static final int DIR_DOWN =1;
+    private static final int DIR_LEFT =2;
+    private static final int DIR_RIGHT=3;
+
+    private static final Static3D VECTX = new Static3D(1,0,0);
+    private static final Static3D VECTY = new Static3D(0,1,0);
+    private static final Static3D VECTZ = new Static3D(0,0,1);
+
+    private boolean mDragging, mRotating;
     private int mX, mY;
     private int mTouchedRow, mTouchedCol, mTouchedSli;
     private Static4D mQuatCurrent, mQuatAccumulated;
     private RubikRenderer mRenderer;
 
+    private float mPoiX, mPoiY, mPoiZ, mCamX, mCamY, mCamZ;
+    private float mStartX, mStartY, mStartZ;
+    private int mLastTouchedFace;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
     public RubikSurfaceView(Context context)
@@ -52,6 +66,7 @@ class RubikSurfaceView extends GLSurfaceView
       super(context);
 
       mDragging = false;
+      mRotating = false;
       mRenderer = new RubikRenderer(this);
 
       mQuatCurrent     = new Static4D(0,0,0,1);
@@ -81,15 +96,19 @@ class RubikSurfaceView extends GLSurfaceView
 
       switch(action)
          {
-         case MotionEvent.ACTION_DOWN: if( faceTouched(x,y) != NONE )
+         case MotionEvent.ACTION_DOWN: mX = x;
+                                       mY = y;
+
+                                       mLastTouchedFace = faceTouched(x,y);
+
+                                       if( mLastTouchedFace != NONE )
                                          {
                                          mRenderer.abortLastEffect();
                                          mRenderer.applyNewEffect(mTouchedCol, mTouchedRow, mTouchedSli);
+                                         mRotating = true;
                                          }
                                        else
                                          {
-                                         mX = x;
-                                         mY = y;
                                          mDragging = true;
                                          }
                                        break;
@@ -98,11 +117,22 @@ class RubikSurfaceView extends GLSurfaceView
                                          mQuatCurrent.set(quatFromDrag(mX-x,mY-y));
                                          mRenderer.setQuatCurrent(mQuatCurrent);
                                          }
+                                       else if( mRotating )
+                                         {
+                                         int minimumToRotate = (mRenderer.mScreenMin*mRenderer.mScreenMin)/36;
+
+                                         if( (mX-x)*(mX-x)+(mY-y)*(mY-y)>minimumToRotate )
+                                           {
+                                           rotateFace(x,y);
+                                           mRotating = false;
+                                           }
+                                         }
                                        break;
          case MotionEvent.ACTION_UP  : mDragging = false;
+                                       mRotating = false;
+
                                        mQuatAccumulated.set(quatMultiply(mQuatCurrent, mQuatAccumulated));
                                        mQuatCurrent.set(0f, 0f, 0f, 1f);
-
                                        mRenderer.setQuatCurrent(mQuatCurrent);
                                        mRenderer.setQuatAccumulated(mQuatAccumulated);
                                        break;
@@ -111,6 +141,79 @@ class RubikSurfaceView extends GLSurfaceView
       return true;
       }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    private void rotateFace(int x, int y)
+      {
+      fillCameraAndTouchPoint(x,y);
+      float cubeHalfSize= mRenderer.returnCubeSize()*0.5f;
+      float A=0f;
+
+      switch(mLastTouchedFace)
+        {
+        case FRONT : A = ( mPoiZ!=mCamZ ? ( cubeHalfSize-mCamZ)/(mPoiZ-mCamZ) : 0f); break;
+        case BACK  : A = ( mPoiZ!=mCamZ ? (-cubeHalfSize-mCamZ)/(mPoiZ-mCamZ) : 0f); break;
+        case LEFT  : A = ( mPoiX!=mCamX ? (-cubeHalfSize-mCamX)/(mPoiX-mCamX) : 0f); break;
+        case RIGHT : A = ( mPoiX!=mCamX ? ( cubeHalfSize-mCamX)/(mPoiX-mCamX) : 0f); break;
+        case TOP   : A = ( mPoiY!=mCamY ? ( cubeHalfSize-mCamY)/(mPoiY-mCamY) : 0f); break;
+        case BOTTOM: A = ( mPoiY!=mCamY ? (-cubeHalfSize-mCamY)/(mPoiY-mCamY) : 0f); break;
+        }
+      float diffX = (mPoiX-mCamX)*A + mCamX - mStartX;
+      float diffY = (mPoiY-mCamY)*A + mCamY - mStartY;
+      float diffZ = (mPoiZ-mCamZ)*A + mCamZ - mStartZ;
+
+      Static3D rotV=VECTX;
+      int dir, rotA =1, rotRC=1;
+
+      switch(mLastTouchedFace)
+        {
+        case FRONT : dir = retDirection( diffX, diffY);
+                     rotV = (dir==DIR_UP || dir==DIR_DOWN) ? VECTX:VECTY;
+                     rotA = (dir==DIR_UP || dir==DIR_LEFT) ? -90:90;
+                     rotRC = (int)( RubikRenderer.NUM_CUBES*((rotV==VECTX?mStartX:mStartY)+cubeHalfSize)/(2*cubeHalfSize) );
+                     break;
+        case BACK  : dir = retDirection(-diffX, diffY);
+                     rotV = (dir==DIR_UP || dir==DIR_DOWN) ? VECTX:VECTY;
+                     rotA = (dir==DIR_UP || dir==DIR_RIGHT) ? 90:-90;
+                     rotRC = (int)( RubikRenderer.NUM_CUBES*((rotV==VECTX?mStartX:mStartY)+cubeHalfSize)/(2*cubeHalfSize) );
+                     break;
+        case LEFT  : dir = retDirection( diffZ, diffY);
+                     rotV = (dir==DIR_UP || dir==DIR_DOWN) ? VECTZ:VECTY;
+                     rotA = (dir==DIR_UP || dir==DIR_LEFT) ? -90:90;
+                     rotRC = (int)( RubikRenderer.NUM_CUBES*((rotV==VECTZ?mStartZ:mStartY)+cubeHalfSize)/(2*cubeHalfSize) );
+                     break;
+        case RIGHT : dir = retDirection(-diffZ, diffY);
+                     rotV = (dir==DIR_UP || dir==DIR_DOWN) ? VECTZ:VECTY;
+                     rotA = (dir==DIR_UP || dir==DIR_RIGHT) ? 90:-90;
+                     rotRC = (int)( RubikRenderer.NUM_CUBES*((rotV==VECTZ?mStartZ:mStartY)+cubeHalfSize)/(2*cubeHalfSize) );
+                     break;
+        case TOP   : dir = retDirection( diffX,-diffZ);
+                     rotV = (dir==DIR_UP || dir==DIR_DOWN) ? VECTX:VECTZ;
+                     rotA = (dir==DIR_UP || dir==DIR_RIGHT) ? -90:90;
+                     rotRC = (int)( RubikRenderer.NUM_CUBES*((rotV==VECTX?mStartX:mStartZ)+cubeHalfSize)/(2*cubeHalfSize) );
+                     break;
+        case BOTTOM: dir = retDirection( diffX, diffZ);
+                     rotV = (dir==DIR_UP || dir==DIR_DOWN) ? VECTX:VECTZ;
+                     rotA = (dir==DIR_UP || dir==DIR_LEFT) ? -90:90;
+                     rotRC = (int)( RubikRenderer.NUM_CUBES*((rotV==VECTX?mStartX:mStartZ)+cubeHalfSize)/(2*cubeHalfSize) );
+                     break;
+        }
+
+      //if( rotRC==cubeHalfSize+1 ) rotRC=cubeHalfSize;
+
+      String vect = (rotV==VECTX ? "X" : (rotV==VECTY? "Y":"Z") );
+
+      android.util.Log.e("rubik", "rotating by "+rotA+" degrees, face="+rotRC+" vector: "+vect);
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    private int retDirection(float a, float b)
+      {
+      if( b>a ) return a>-b ? DIR_UP   :DIR_LEFT;
+      else      return a>-b ? DIR_RIGHT:DIR_DOWN;
+      }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // return quat1*quat2
 
@@ -221,34 +324,20 @@ class RubikSurfaceView extends GLSurfaceView
 
     private int faceTouched(int xTouch, int yTouch)
       {
-      float cameraDistance = mRenderer.returnCameraDistance();
-      float halfScrWidth   = mRenderer.getScreenWidth()*0.5f;
-      float halfScrHeight  = mRenderer.getScreenHeight()*0.5f;
-      float cubeHalfSize   = mRenderer.returnCubeSize()*0.5f;
+      float cubeHalfSize= mRenderer.returnCubeSize()*0.5f;
 
-      Static4D cameraPoint = new Static4D(                  0,                    0, cameraDistance, 0);
-      Static4D touchPoint  = new Static4D(xTouch-halfScrWidth, halfScrHeight-yTouch,              0, 0);
-
-      Static4D rotatedCamera    = rotateVector(cameraPoint);
-      Static4D rotatedTouchPoint= rotateVector(touchPoint);
-
-      float camX = rotatedCamera.get1();
-      float camY = rotatedCamera.get2();
-      float camZ = rotatedCamera.get3();
-
-      float poiX = rotatedTouchPoint.get1();
-      float poiY = rotatedTouchPoint.get2();
-      float poiZ = rotatedTouchPoint.get3();
+      fillCameraAndTouchPoint(xTouch,yTouch);
 
       if( faceIsVisible(FRONT) )
         {
-        if( poiZ!= camZ )
+        if( mPoiZ!= mCamZ )
           {
-          float A = (cubeHalfSize-camZ)/(poiZ-camZ);
-          float X = (poiX-camX)*A + camX;
-          float Y = (poiY-camY)*A + camY;
-          float qX= (X+cubeHalfSize) / (2*cubeHalfSize);
-          float qY= (Y+cubeHalfSize) / (2*cubeHalfSize);
+          float A = (cubeHalfSize-mCamZ)/(mPoiZ-mCamZ);
+          mStartX = (mPoiX-mCamX)*A + mCamX;
+          mStartY = (mPoiY-mCamY)*A + mCamY;
+          mStartZ = (mPoiZ-mCamZ)*A + mCamZ;
+          float qX= (mStartX+cubeHalfSize) / (2*cubeHalfSize);
+          float qY= (mStartY+cubeHalfSize) / (2*cubeHalfSize);
 
           if( qX<=1 && qX>=0 && qY<=1 && qY>=0 )
             {
@@ -261,13 +350,14 @@ class RubikSurfaceView extends GLSurfaceView
         }
       if( faceIsVisible(BACK) )
         {
-        if( poiZ!= camZ )
+        if( mPoiZ!= mCamZ )
           {
-          float A = (-cubeHalfSize-camZ)/(poiZ-camZ);
-          float X = (poiX-camX)*A + camX;
-          float Y = (poiY-camY)*A + camY;
-          float qX= (X+cubeHalfSize) / (2*cubeHalfSize);
-          float qY= (Y+cubeHalfSize) / (2*cubeHalfSize);
+          float A = (-cubeHalfSize-mCamZ)/(mPoiZ-mCamZ);
+          mStartX = (mPoiX-mCamX)*A + mCamX;
+          mStartY = (mPoiY-mCamY)*A + mCamY;
+          mStartZ = (mPoiZ-mCamZ)*A + mCamZ;
+          float qX= (mStartX+cubeHalfSize) / (2*cubeHalfSize);
+          float qY= (mStartY+cubeHalfSize) / (2*cubeHalfSize);
 
           if( qX<=1 && qX>=0 && qY<=1 && qY>=0 )
             {
@@ -280,13 +370,14 @@ class RubikSurfaceView extends GLSurfaceView
         }
       if( faceIsVisible(LEFT) )
         {
-        if( poiX!= camX )
+        if( mPoiX!= mCamX )
           {
-          float A = (-cubeHalfSize-camX)/(poiX-camX);
-          float Y = (poiY-camY)*A + camY;
-          float Z = (poiZ-camZ)*A + camZ;
-          float qY= (Y+cubeHalfSize) / (2*cubeHalfSize);
-          float qZ= (Z+cubeHalfSize) / (2*cubeHalfSize);
+          float A = (-cubeHalfSize-mCamX)/(mPoiX-mCamX);
+          mStartX = (mPoiX-mCamX)*A + mCamX;
+          mStartY = (mPoiY-mCamY)*A + mCamY;
+          mStartZ = (mPoiZ-mCamZ)*A + mCamZ;
+          float qY= (mStartY+cubeHalfSize) / (2*cubeHalfSize);
+          float qZ= (mStartZ+cubeHalfSize) / (2*cubeHalfSize);
 
           if( qZ<=1 && qZ>=0 && qY<=1 && qY>=0 )
             {
@@ -299,13 +390,14 @@ class RubikSurfaceView extends GLSurfaceView
         }
       if( faceIsVisible(RIGHT) )
         {
-        if( poiX!= camX )
+        if( mPoiX!= mCamX )
           {
-          float A = (cubeHalfSize-camX)/(poiX-camX);
-          float Y = (poiY-camY)*A + camY;
-          float Z = (poiZ-camZ)*A + camZ;
-          float qY= (Y+cubeHalfSize) / (2*cubeHalfSize);
-          float qZ= (Z+cubeHalfSize) / (2*cubeHalfSize);
+          float A = (cubeHalfSize-mCamX)/(mPoiX-mCamX);
+          mStartX = (mPoiX-mCamX)*A + mCamX;
+          mStartY = (mPoiY-mCamY)*A + mCamY;
+          mStartZ = (mPoiZ-mCamZ)*A + mCamZ;
+          float qY= (mStartY+cubeHalfSize) / (2*cubeHalfSize);
+          float qZ= (mStartZ+cubeHalfSize) / (2*cubeHalfSize);
 
           if( qZ<=1 && qZ>=0 && qY<=1 && qY>=0 )
             {
@@ -318,13 +410,14 @@ class RubikSurfaceView extends GLSurfaceView
         }
       if( faceIsVisible(TOP) )
         {
-        if( poiY!= camY )
+        if( mPoiY!= mCamY )
           {
-          float A = (cubeHalfSize-camY)/(poiY-camY);
-          float X = (poiX-camX)*A + camX;
-          float Z = (poiZ-camZ)*A + camZ;
-          float qX= (X+cubeHalfSize) / (2*cubeHalfSize);
-          float qZ= (Z+cubeHalfSize) / (2*cubeHalfSize);
+          float A = (cubeHalfSize-mCamY)/(mPoiY-mCamY);
+          mStartX = (mPoiX-mCamX)*A + mCamX;
+          mStartY = (mPoiY-mCamY)*A + mCamY;
+          mStartZ = (mPoiZ-mCamZ)*A + mCamZ;
+          float qX= (mStartX+cubeHalfSize) / (2*cubeHalfSize);
+          float qZ= (mStartZ+cubeHalfSize) / (2*cubeHalfSize);
 
           if( qZ<=1 && qZ>=0 && qX<=1 && qX>=0 )
             {
@@ -337,13 +430,14 @@ class RubikSurfaceView extends GLSurfaceView
         }
       if( faceIsVisible(BOTTOM) )
         {
-        if( poiY!= camY )
+        if( mPoiY!= mCamY )
           {
-          float A = (-cubeHalfSize-camY)/(poiY-camY);
-          float X = (poiX-camX)*A + camX;
-          float Z = (poiZ-camZ)*A + camZ;
-          float qX= (X+cubeHalfSize) / (2*cubeHalfSize);
-          float qZ= (Z+cubeHalfSize) / (2*cubeHalfSize);
+          float A = (-cubeHalfSize-mCamY)/(mPoiY-mCamY);
+          mStartX = (mPoiX-mCamX)*A + mCamX;
+          mStartY = (mPoiY-mCamY)*A + mCamY;
+          mStartZ = (mPoiZ-mCamZ)*A + mCamZ;
+          float qX= (mStartX+cubeHalfSize) / (2*cubeHalfSize);
+          float qZ= (mStartZ+cubeHalfSize) / (2*cubeHalfSize);
 
           if( qZ<=1 && qZ>=0 && qX<=1 && qX>=0 )
             {
@@ -361,5 +455,28 @@ class RubikSurfaceView extends GLSurfaceView
 
       return NONE;
       }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    void fillCameraAndTouchPoint(int x, int y)
+      {
+      float cameraDistance = mRenderer.returnCameraDistance();
+      float halfScrWidth   = mRenderer.getScreenWidth()*0.5f;
+      float halfScrHeight  = mRenderer.getScreenHeight()*0.5f;
+
+      Static4D cameraPoint = new Static4D(             0,               0, cameraDistance, 0);
+      Static4D touchPoint  = new Static4D(x-halfScrWidth, halfScrHeight-y,              0, 0);
+
+      Static4D rotatedCamera    = rotateVector(cameraPoint);
+      Static4D rotatedTouchPoint= rotateVector(touchPoint);
+
+      mCamX = rotatedCamera.get1();
+      mCamY = rotatedCamera.get2();
+      mCamZ = rotatedCamera.get3();
+
+      mPoiX = rotatedTouchPoint.get1();
+      mPoiY = rotatedTouchPoint.get2();
+      mPoiZ = rotatedTouchPoint.get3();
+      }
 }
 
