commit 10d5383955c8a7156bbe876389d070804fa2b695
Author: Leszek Koltunski <leszek@distorted.org>
Date:   Wed Dec 7 23:58:48 2016 +0000

    Turn the former 'FOV' app into 'Projection' app that also checks the (x,y) the camera looks at.

diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml
index e76e0c3..653a28a 100644
--- a/src/main/AndroidManifest.xml
+++ b/src/main/AndroidManifest.xml
@@ -19,7 +19,7 @@
         <activity android:name=".monalisa.MonaLisaActivity" />
         <activity android:name=".sink.SinkActivity" />
         <activity android:name=".bean.BeanActivity" />
-        <activity android:name=".fov.FOVActivity" />
+        <activity android:name=".projection.ProjectionActivity" />
         <activity android:name=".deform.DeformActivity" />    
         <activity android:name=".listener.ListenerActivity" />    
         <activity android:name=".dynamic.DynamicActivity" />
diff --git a/src/main/java/org/distorted/examples/TableOfContents.java b/src/main/java/org/distorted/examples/TableOfContents.java
index 0ec3f10..98770e4 100644
--- a/src/main/java/org/distorted/examples/TableOfContents.java
+++ b/src/main/java/org/distorted/examples/TableOfContents.java
@@ -37,7 +37,7 @@ import android.widget.SimpleAdapter;
 import org.distorted.examples.aroundtheworld.AroundTheWorldActivity;
 import org.distorted.examples.monalisa.MonaLisaActivity;
 import org.distorted.examples.sink.SinkActivity;
-import org.distorted.examples.fov.FOVActivity;
+import org.distorted.examples.projection.ProjectionActivity;
 import org.distorted.examples.deform.DeformActivity;
 import org.distorted.examples.listener.ListenerActivity;
 import org.distorted.examples.dynamic.DynamicActivity;
@@ -60,7 +60,6 @@ import org.distorted.examples.plainmonalisa.PlainMonaLisaActivity;
 import org.distorted.examples.save.SaveActivity;
 import org.distorted.examples.flag.FlagActivity;
 import org.distorted.examples.wind.WindActivity;
-import org.distorted.examples.aroundtheworld.AroundTheWorldActivity;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -112,11 +111,11 @@ public class TableOfContents extends ListActivity
    
    {
       final Map<String, Object> item = new HashMap<>();
-      item.put(ITEM_IMAGE, R.drawable.icon_example_fov);
-      item.put(ITEM_TITLE, (i+1)+". "+getText(R.string.example_fov));
-      item.put(ITEM_SUBTITLE, getText(R.string.example_fov_subtitle));
+      item.put(ITEM_IMAGE, R.drawable.icon_example_projection);
+      item.put(ITEM_TITLE, (i+1)+". "+getText(R.string.example_projection));
+      item.put(ITEM_SUBTITLE, getText(R.string.example_projection_subtitle));
       data.add(item);
-      activityMapping.put(i++, FOVActivity.class);
+      activityMapping.put(i++, ProjectionActivity.class);
    }
          
    {
diff --git a/src/main/java/org/distorted/examples/fov/FOVActivity.java b/src/main/java/org/distorted/examples/fov/FOVActivity.java
deleted file mode 100644
index 73b5893..0000000
--- a/src/main/java/org/distorted/examples/fov/FOVActivity.java
+++ /dev/null
@@ -1,109 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2016 Leszek Koltunski                                                               //
-//                                                                                               //
-// This file is part of Distorted.                                                               //
-//                                                                                               //
-// Distorted is free software: you can redistribute it and/or modify                             //
-// it under the terms of the GNU General Public License as published by                          //
-// the Free Software Foundation, either version 2 of the License, or                             //
-// (at your option) any later version.                                                           //
-//                                                                                               //
-// Distorted is distributed in the hope that it will be useful,                                  //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
-// GNU General Public License for more details.                                                  //
-//                                                                                               //
-// You should have received a copy of the GNU General Public License                             //
-// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-package org.distorted.examples.fov;
-
-import org.distorted.library.Distorted;
-import org.distorted.examples.R;
-
-import android.app.Activity;
-import android.opengl.GLSurfaceView;
-import android.os.Bundle;
-import android.widget.SeekBar;
-import android.widget.TextView;
-import android.widget.SeekBar.OnSeekBarChangeListener;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-public class FOVActivity extends Activity implements OnSeekBarChangeListener
-{
-    private TextView textFOV;
-    
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    @Override
-    protected void onCreate(Bundle icicle) 
-      {
-      super.onCreate(icicle);
-      setContentView(R.layout.fovlayout);
-       
-      SeekBar barFOV = (SeekBar)findViewById(R.id.seekFOV);
-      barFOV.setOnSeekBarChangeListener(this); 
-        
-      textFOV = (TextView)findViewById(R.id.textFOV);
-     
-      barFOV.setProgress(50);
-      
-      textFOV.setText("FOV: 50");
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    @Override
-    protected void onPause() 
-      {
-      GLSurfaceView mView = (GLSurfaceView) this.findViewById(R.id.surfaceViewFOV);
-      mView.onPause();
-      
-      super.onPause();
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    @Override
-    protected void onResume() 
-      {
-      super.onResume();
-      
-      GLSurfaceView mView = (GLSurfaceView) this.findViewById(R.id.surfaceViewFOV);
-      mView.onResume();    
-      }
- 
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    @Override
-    protected void onDestroy() 
-      {
-      Distorted.onDestroy();  
-      super.onDestroy();
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    public void onProgressChanged(SeekBar bar, int progress, boolean fromUser) 
-      {
-      switch (bar.getId()) 
-        {
-        case R.id.seekFOV: FOVRenderer.setFOV(progress);
-                           textFOV.setText("FOV: "+progress);
-                           break;
-        }
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    public void onStartTrackingTouch(SeekBar bar) { }
-    
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    public void onStopTrackingTouch(SeekBar bar)  { }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-}
diff --git a/src/main/java/org/distorted/examples/fov/FOVRenderer.java b/src/main/java/org/distorted/examples/fov/FOVRenderer.java
deleted file mode 100644
index c3616de..0000000
--- a/src/main/java/org/distorted/examples/fov/FOVRenderer.java
+++ /dev/null
@@ -1,128 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2016 Leszek Koltunski                                                               //
-//                                                                                               //
-// This file is part of Distorted.                                                               //
-//                                                                                               //
-// Distorted is free software: you can redistribute it and/or modify                             //
-// it under the terms of the GNU General Public License as published by                          //
-// the Free Software Foundation, either version 2 of the License, or                             //
-// (at your option) any later version.                                                           //
-//                                                                                               //
-// Distorted is distributed in the hope that it will be useful,                                  //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
-// GNU General Public License for more details.                                                  //
-//                                                                                               //
-// You should have received a copy of the GNU General Public License                             //
-// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-package org.distorted.examples.fov;
-
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-
-import org.distorted.library.Distorted;
-import org.distorted.library.DistortedBitmap;
-import org.distorted.library.type.Static2D;
-import org.distorted.library.type.Static3D;
-import org.distorted.library.type.Static4D;
-
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.Paint.Style;
-import android.opengl.GLES20;
-import android.opengl.GLSurfaceView;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-class FOVRenderer implements GLSurfaceView.Renderer 
-{
-   private static final int NUMLINES = 10;
-   
-   private GLSurfaceView mView;
-   private DistortedBitmap fov;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-   FOVRenderer(GLSurfaceView view)
-      { 
-      mView = view;
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-   static void setFOV(int fov)
-      {
-      Distorted.setFov(fov);
-      }
-   
-///////////////////////////////////////////////////////////////////////////////////////////////////
-   
-   public void onDrawFrame(GL10 glUnused) 
-      {
-      GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
-      fov.draw(System.currentTimeMillis());
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-   public void onSurfaceChanged(GL10 glUnused, int width, int height) 
-      { 
-      Distorted.onSurfaceChanged(width, height);
-      setupBitmap(width,height);
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-   public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
-      {
-      GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
-
-      try
-        {
-        Distorted.onSurfaceCreated(mView.getContext());
-        }
-      catch(Exception ex)
-        {
-        android.util.Log.e("FOV", ex.getMessage() );
-        }
-      }
-    
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    private void setupBitmap(int w, int h)
-      {
-      Paint paint = new Paint();
-      fov = new DistortedBitmap(w,h, 50);
-      Bitmap fovBitmap = Bitmap.createBitmap(w,h, Bitmap.Config.ARGB_8888);
-      Canvas fovCanvas = new Canvas(fovBitmap);    
-
-      paint.setColor(0xff008800);
-      paint.setStyle(Style.FILL);
-      fovCanvas.drawRect(0, 0, w, h, paint);
-      paint.setColor(0xffffffff);
-      
-      for(int i=0; i<=NUMLINES ; i++ )
-        {
-        fovCanvas.drawRect(w*i/NUMLINES - 1,                0,  w*i/NUMLINES + 1,  h               , paint);
-        fovCanvas.drawRect(               0, h *i/NUMLINES -1,  w               ,  h*i/NUMLINES + 1, paint);
-        }
-        
-      fov.setBitmap(fovBitmap);
-        
-      int min = w<h ? w:h;
-        
-      Static3D vector = new Static3D(0,0,min/5);
-      Static4D region = new Static4D(0,0,min/5,min/5);
-
-      fov.distort(vector, new Static3D(  w/4,   h/4, 0), region);
-      fov.distort(vector, new Static3D(3*w/4,   h/4, 0), region);
-      fov.distort(vector, new Static3D(  w/4, 3*h/4, 0), region);
-      fov.distort(vector, new Static3D(3*w/4, 3*h/4, 0), region);
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-}
diff --git a/src/main/java/org/distorted/examples/fov/FOVSurfaceView.java b/src/main/java/org/distorted/examples/fov/FOVSurfaceView.java
deleted file mode 100644
index 830af61..0000000
--- a/src/main/java/org/distorted/examples/fov/FOVSurfaceView.java
+++ /dev/null
@@ -1,44 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2016 Leszek Koltunski                                                               //
-//                                                                                               //
-// This file is part of Distorted.                                                               //
-//                                                                                               //
-// Distorted is free software: you can redistribute it and/or modify                             //
-// it under the terms of the GNU General Public License as published by                          //
-// the Free Software Foundation, either version 2 of the License, or                             //
-// (at your option) any later version.                                                           //
-//                                                                                               //
-// Distorted is distributed in the hope that it will be useful,                                  //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
-// GNU General Public License for more details.                                                  //
-//                                                                                               //
-// You should have received a copy of the GNU General Public License                             //
-// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-package org.distorted.examples.fov;
-
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.os.Build;
-import android.util.AttributeSet;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-class FOVSurfaceView extends GLSurfaceView 
-{
-///////////////////////////////////////////////////////////////////////////////////////////////////
-   
-    public FOVSurfaceView(Context c, AttributeSet attrs) 
-      {
-      super(c, attrs);
-    
-      if(!isInEditMode())
-        {
-        setEGLContextClientVersion(2);
-        setRenderer(new FOVRenderer(this));
-        }
-      }
-}
-
diff --git a/src/main/java/org/distorted/examples/projection/ProjectionActivity.java b/src/main/java/org/distorted/examples/projection/ProjectionActivity.java
new file mode 100644
index 0000000..736376a
--- /dev/null
+++ b/src/main/java/org/distorted/examples/projection/ProjectionActivity.java
@@ -0,0 +1,124 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2016 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Distorted.                                                               //
+//                                                                                               //
+// Distorted is free software: you can redistribute it and/or modify                             //
+// it under the terms of the GNU General Public License as published by                          //
+// the Free Software Foundation, either version 2 of the License, or                             //
+// (at your option) any later version.                                                           //
+//                                                                                               //
+// Distorted is distributed in the hope that it will be useful,                                  //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
+// GNU General Public License for more details.                                                  //
+//                                                                                               //
+// You should have received a copy of the GNU General Public License                             //
+// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.examples.projection;
+
+import org.distorted.library.Distorted;
+import org.distorted.examples.R;
+
+import android.app.Activity;
+import android.opengl.GLSurfaceView;
+import android.os.Bundle;
+import android.widget.SeekBar;
+import android.widget.TextView;
+import android.widget.SeekBar.OnSeekBarChangeListener;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+public class ProjectionActivity extends Activity implements OnSeekBarChangeListener
+{
+    private TextView textF, textX, textY;
+    
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+    @Override
+    protected void onCreate(Bundle icicle) 
+      {
+      super.onCreate(icicle);
+      setContentView(R.layout.projectionlayout);
+
+      textF = (TextView)findViewById(R.id.projectionTextFOV);
+      textX = (TextView)findViewById(R.id.projectionTextX);
+      textY = (TextView)findViewById(R.id.projectionTextY);
+
+      SeekBar bar;
+
+      bar = (SeekBar)findViewById(R.id.projectionSeekFOV);
+      bar.setOnSeekBarChangeListener(this);
+      bar.setProgress(50);
+      bar = (SeekBar)findViewById(R.id.projectionSeekX);
+      bar.setOnSeekBarChangeListener(this);
+      bar.setProgress(50);
+      bar = (SeekBar)findViewById(R.id.projectionSeekY);
+      bar.setOnSeekBarChangeListener(this);
+      bar.setProgress(50);
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+    @Override
+    protected void onPause() 
+      {
+      GLSurfaceView mView = (GLSurfaceView) this.findViewById(R.id.surfaceViewProjection);
+      mView.onPause();
+      
+      super.onPause();
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+    @Override
+    protected void onResume() 
+      {
+      super.onResume();
+      
+      GLSurfaceView mView = (GLSurfaceView) this.findViewById(R.id.surfaceViewProjection);
+      mView.onResume();    
+      }
+ 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+    @Override
+    protected void onDestroy() 
+      {
+      Distorted.onDestroy();  
+      super.onDestroy();
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+    public void onProgressChanged(SeekBar bar, int progress, boolean fromUser) 
+      {
+      int ret;
+
+      switch (bar.getId()) 
+        {
+        case R.id.projectionSeekFOV: ret = ProjectionRenderer.setFOV(progress);
+                                     textF.setText("FOV: "+ret);
+                                     break;
+        case R.id.projectionSeekX  : ret = ProjectionRenderer.setX(progress);
+                                     textX.setText("X: "+ret);
+                                     break;
+        case R.id.projectionSeekY  : ret = ProjectionRenderer.setY(progress);
+                                     textY.setText("Y: "+ret);
+                                     break;
+        }
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    public void onStartTrackingTouch(SeekBar bar) { }
+    
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    public void onStopTrackingTouch(SeekBar bar)  { }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+}
diff --git a/src/main/java/org/distorted/examples/projection/ProjectionRenderer.java b/src/main/java/org/distorted/examples/projection/ProjectionRenderer.java
new file mode 100644
index 0000000..37e314f
--- /dev/null
+++ b/src/main/java/org/distorted/examples/projection/ProjectionRenderer.java
@@ -0,0 +1,153 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2016 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Distorted.                                                               //
+//                                                                                               //
+// Distorted is free software: you can redistribute it and/or modify                             //
+// it under the terms of the GNU General Public License as published by                          //
+// the Free Software Foundation, either version 2 of the License, or                             //
+// (at your option) any later version.                                                           //
+//                                                                                               //
+// Distorted is distributed in the hope that it will be useful,                                  //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
+// GNU General Public License for more details.                                                  //
+//                                                                                               //
+// You should have received a copy of the GNU General Public License                             //
+// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.examples.projection;
+
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.opengles.GL10;
+
+import org.distorted.library.Distorted;
+import org.distorted.library.DistortedBitmap;
+import org.distorted.library.type.Static3D;
+import org.distorted.library.type.Static4D;
+
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.Paint.Style;
+import android.opengl.GLES20;
+import android.opengl.GLSurfaceView;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class ProjectionRenderer implements GLSurfaceView.Renderer
+{
+   private GLSurfaceView mView;
+   private DistortedBitmap mProjection;
+
+   private static float mF, mX, mY;
+   private static int mWidth, mHeight;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   ProjectionRenderer(GLSurfaceView view)
+      { 
+      mView = view;
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   static int setFOV(int f)
+      {
+      mF = f;
+      Distorted.setProjection(mF,mX,mY);
+      return (int)mF;
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   static int setX(int x)
+      {
+      mX = (x-50)*0.01f*mWidth;
+      Distorted.setProjection(mF,mX,mY);
+      return (int)mX;
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   static int setY(int y)
+      {
+      mY = (y-50)*0.01f*mHeight;
+      Distorted.setProjection(mF,mX,mY);
+      return (int)mY;
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+   
+   public void onDrawFrame(GL10 glUnused) 
+      {
+      GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
+      mProjection.draw(System.currentTimeMillis());
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+   public void onSurfaceChanged(GL10 glUnused, int width, int height) 
+      {
+      mWidth = width;
+      mHeight= height;
+
+      Distorted.onSurfaceChanged(width, height);
+      setupBitmap(width,height);
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+   public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
+      {
+      GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
+
+      try
+        {
+        Distorted.onSurfaceCreated(mView.getContext());
+        }
+      catch(Exception ex)
+        {
+        android.util.Log.e("Projection", ex.getMessage() );
+        }
+      }
+    
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    private void setupBitmap(int w, int h)
+      {
+      Paint paint = new Paint();
+      mProjection = new DistortedBitmap(w,h, 50);
+      Bitmap bmp = Bitmap.createBitmap(w,h, Bitmap.Config.ARGB_8888);
+      Canvas bmpCanvas = new Canvas(bmp);
+
+      paint.setColor(0xff008800);
+      paint.setStyle(Style.FILL);
+      bmpCanvas.drawRect(0, 0, w, h, paint);
+      paint.setColor(0xffffffff);
+
+      final int NUMLINES = 10;
+
+      for(int i=0; i<=NUMLINES ; i++ )
+        {
+        bmpCanvas.drawRect(w*i/NUMLINES - 1,                0,  w*i/NUMLINES + 1,  h               , paint);
+        bmpCanvas.drawRect(               0, h *i/NUMLINES -1,  w               ,  h*i/NUMLINES + 1, paint);
+        }
+        
+      mProjection.setBitmap(bmp);
+        
+      int min = w<h ? w:h;
+        
+      Static3D vector = new Static3D(0,0,min/5);
+      Static4D region = new Static4D(0,0,min/5,min/5);
+
+      mProjection.distort(vector, new Static3D(  w/4,   h/4, 0), region);
+      mProjection.distort(vector, new Static3D(3*w/4,   h/4, 0), region);
+      mProjection.distort(vector, new Static3D(  w/4, 3*h/4, 0), region);
+      mProjection.distort(vector, new Static3D(3*w/4, 3*h/4, 0), region);
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+}
diff --git a/src/main/java/org/distorted/examples/projection/ProjectionSurfaceView.java b/src/main/java/org/distorted/examples/projection/ProjectionSurfaceView.java
new file mode 100644
index 0000000..e5fd3b1
--- /dev/null
+++ b/src/main/java/org/distorted/examples/projection/ProjectionSurfaceView.java
@@ -0,0 +1,43 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2016 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Distorted.                                                               //
+//                                                                                               //
+// Distorted is free software: you can redistribute it and/or modify                             //
+// it under the terms of the GNU General Public License as published by                          //
+// the Free Software Foundation, either version 2 of the License, or                             //
+// (at your option) any later version.                                                           //
+//                                                                                               //
+// Distorted is distributed in the hope that it will be useful,                                  //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
+// GNU General Public License for more details.                                                  //
+//                                                                                               //
+// You should have received a copy of the GNU General Public License                             //
+// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.examples.projection;
+
+import android.content.Context;
+import android.opengl.GLSurfaceView;
+import android.util.AttributeSet;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class ProjectionSurfaceView extends GLSurfaceView
+{
+///////////////////////////////////////////////////////////////////////////////////////////////////
+   
+    public ProjectionSurfaceView(Context c, AttributeSet attrs)
+      {
+      super(c, attrs);
+    
+      if(!isInEditMode())
+        {
+        setEGLContextClientVersion(2);
+        setRenderer(new ProjectionRenderer(this));
+        }
+      }
+}
+
diff --git a/src/main/java/org/distorted/examples/starwars/StarWarsRenderer.java b/src/main/java/org/distorted/examples/starwars/StarWarsRenderer.java
index 0d9d410..a7c16bd 100644
--- a/src/main/java/org/distorted/examples/starwars/StarWarsRenderer.java
+++ b/src/main/java/org/distorted/examples/starwars/StarWarsRenderer.java
@@ -113,7 +113,7 @@ class StarWarsRenderer implements GLSurfaceView.Renderer, EffectListener
     {
     mView = v;
      
-    Distorted.setFov(60.0f);
+    Distorted.setProjection(60.0f, 0.0f, 0.0f);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/res/drawable-hdpi/icon_example_fov.png b/src/main/res/drawable-hdpi/icon_example_fov.png
deleted file mode 100644
index ecd1a29..0000000
Binary files a/src/main/res/drawable-hdpi/icon_example_fov.png and /dev/null differ
diff --git a/src/main/res/drawable-hdpi/icon_example_projection.png b/src/main/res/drawable-hdpi/icon_example_projection.png
new file mode 100644
index 0000000..ecd1a29
Binary files /dev/null and b/src/main/res/drawable-hdpi/icon_example_projection.png differ
diff --git a/src/main/res/layout/fovlayout.xml b/src/main/res/layout/fovlayout.xml
deleted file mode 100644
index dbfcf1d..0000000
--- a/src/main/res/layout/fovlayout.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:orientation="vertical" >
-
-    <org.distorted.examples.fov.FOVSurfaceView
-        android:id="@+id/surfaceViewFOV"
-        android:layout_width="fill_parent"
-        android:layout_height="0dp"
-        android:layout_weight="1" />
-
-    <LinearLayout
-        android:id="@+id/linearLayout1"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center|fill_horizontal"
-        android:orientation="horizontal"
-        android:paddingBottom="10dp"
-        android:paddingTop="10dp" >
-
-        <TextView
-            android:id="@+id/textFOV"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_weight="0.5"
-            android:paddingLeft="15dp"
-            android:textAppearance="?android:attr/textAppearanceMedium" />
-
-        <SeekBar
-            android:id="@+id/seekFOV"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:paddingLeft="15dp"
-            android:paddingRight="10dp" />
-
-    </LinearLayout>
-
-</LinearLayout>
diff --git a/src/main/res/layout/projectionlayout.xml b/src/main/res/layout/projectionlayout.xml
new file mode 100644
index 0000000..3c0edfe
--- /dev/null
+++ b/src/main/res/layout/projectionlayout.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:orientation="vertical" >
+
+    <org.distorted.examples.projection.ProjectionSurfaceView
+        android:id="@+id/surfaceViewProjection"
+        android:layout_width="fill_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1" />
+
+    <LinearLayout
+        android:id="@+id/linearLayout1"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center|fill_horizontal"
+        android:orientation="horizontal"
+        android:paddingBottom="5dp"
+        android:paddingTop="5dp" >
+
+        <TextView
+            android:id="@+id/projectionTextFOV"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="0.5"
+            android:paddingStart="15dp"
+            android:textAppearance="?android:attr/textAppearanceMedium" />
+
+        <SeekBar
+            android:id="@+id/projectionSeekFOV"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:paddingStart="15dp"
+            android:paddingEnd="15dp" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/linearLayout2"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center|fill_horizontal"
+        android:orientation="horizontal"
+        android:paddingBottom="5dp"
+        android:paddingTop="5dp" >
+
+        <TextView
+            android:id="@+id/projectionTextX"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="0.5"
+            android:paddingStart="15dp"
+            android:textAppearance="?android:attr/textAppearanceMedium" />
+
+        <SeekBar
+            android:id="@+id/projectionSeekX"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:paddingStart="15dp"
+            android:paddingEnd="15dp" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/linearLayout3"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center|fill_horizontal"
+        android:orientation="horizontal"
+        android:paddingBottom="5dp"
+        android:paddingTop="5dp" >
+
+        <TextView
+            android:id="@+id/projectionTextY"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="0.5"
+            android:paddingStart="15dp"
+            android:textAppearance="?android:attr/textAppearanceMedium" />
+
+        <SeekBar
+            android:id="@+id/projectionSeekY"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:paddingStart="15dp"
+            android:paddingEnd="15dp" />
+    </LinearLayout>
+
+</LinearLayout>
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 7171f8c..a486247 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -64,8 +64,8 @@
     <string name="example_sink_subtitle">Learn about sinks.</string>
     <string name="example_bean">Mr. Bean</string>  
     <string name="example_bean_subtitle">Interpolation between more than two Points.</string>
-    <string name="example_fov">Field Of View</string>  
-    <string name="example_fov_subtitle">Adjust the Projection Matrix.</string>
+    <string name="example_projection">Projection</string>
+    <string name="example_projection_subtitle">Adjust the Projection Matrix.</string>
     <string name="example_deform">Deformations and Distortions</string>  
     <string name="example_deform_subtitle">Deform the whole bitmap or Distort a part of it.</string>
     <string name="example_listener">DistortedListener</string>  
