commit 64558e4ea37a4d9ad2f92fe91494918f3258aab7
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Thu Dec 20 00:19:11 2018 +0000

    Rename the old 'Cubes' app to 'Inflate' - this now combines the testing functionality of former 'Cubes' and 'Inflate' apps.
    The old 'Inflate' in turn renamed to 'Earth' - here we are going to show an Earth rotating in space.

diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml
index 8bf894c..ba87fd1 100644
--- a/src/main/AndroidManifest.xml
+++ b/src/main/AndroidManifest.xml
@@ -31,8 +31,9 @@
         <activity android:name=".check.CheckActivity" />    
         <activity android:name=".objecttree.ObjectTreeActivity" />
         <activity android:name=".starwars.StarWarsActivity" />      
-        <activity android:name=".olimpic.OlimpicActivity" />  
-        <activity android:name=".cubes.CubesActivity" />       
+        <activity android:name=".olimpic.OlimpicActivity" />
+        <activity android:name=".inflate.InflateActivity" />
+        <activity android:name=".inflate.InflateActivity2" />
         <activity android:name=".quaternion.QuaternionActivity" />          
         <activity android:name=".effects3d.Effects3DActivity" />
         <activity android:name=".effects3d.Effects3DActivity2"/>
@@ -50,7 +51,7 @@
         <activity android:name=".stencil.StencilActivity"/>
         <activity android:name=".glow.GlowActivity"/>
         <activity android:name=".movingglow.MovingGlowActivity"/>
-        <activity android:name=".inflate.InflateActivity"/>
-        <activity android:name=".inflate.InflateActivity2"/>
+        <activity android:name=".earth.EarthActivity"/>
+        <activity android:name=".earth.EarthActivity2"/>
     </application>
 </manifest>
diff --git a/src/main/java/org/distorted/examples/TableOfContents.java b/src/main/java/org/distorted/examples/TableOfContents.java
index dc8f054..cf18ee0 100644
--- a/src/main/java/org/distorted/examples/TableOfContents.java
+++ b/src/main/java/org/distorted/examples/TableOfContents.java
@@ -51,7 +51,7 @@ import org.distorted.examples.check.CheckActivity;
 import org.distorted.examples.bean.BeanActivity;
 import org.distorted.examples.objecttree.ObjectTreeActivity;
 import org.distorted.examples.starwars.StarWarsActivity;
-import org.distorted.examples.cubes.CubesActivity;
+import org.distorted.examples.inflate.InflateActivity;
 import org.distorted.examples.quaternion.QuaternionActivity;
 import org.distorted.examples.effects3d.Effects3DActivity;
 import org.distorted.examples.plainmonalisa.PlainMonaLisaActivity;
@@ -68,7 +68,7 @@ import org.distorted.examples.postprocesstree.PostprocessTreeActivity;
 import org.distorted.examples.stencil.StencilActivity;
 import org.distorted.examples.glow.GlowActivity;
 import org.distorted.examples.movingglow.MovingGlowActivity;
-import org.distorted.examples.inflate.InflateActivity;
+import org.distorted.examples.earth.EarthActivity;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -256,10 +256,10 @@ public class TableOfContents extends ListActivity
    {
       final Map<String, Object> item = new HashMap<>();
       item.put(ITEM_IMAGE, R.drawable.icon_example_cubes);
-      item.put(ITEM_TITLE, (i+1)+". "+getText(R.string.example_cubes));
-      item.put(ITEM_SUBTITLE, getText(R.string.example_cubes_subtitle));
+      item.put(ITEM_TITLE, (i+1)+". "+getText(R.string.example_inflate));
+      item.put(ITEM_SUBTITLE, getText(R.string.example_inflate_subtitle));
       data.add(item);
-      activityMapping.put(i++, CubesActivity.class);
+      activityMapping.put(i++, InflateActivity.class);
    }
 
    {
@@ -400,10 +400,10 @@ public class TableOfContents extends ListActivity
    {
    final Map<String, Object> item = new HashMap<>();
    item.put(ITEM_IMAGE, R.drawable.icon_example_wip);
-   item.put(ITEM_TITLE, (i+1)+". "+getText(R.string.example_inflate));
-   item.put(ITEM_SUBTITLE, getText(R.string.example_inflate_subtitle));
+   item.put(ITEM_TITLE, (i+1)+". "+getText(R.string.example_earth));
+   item.put(ITEM_SUBTITLE, getText(R.string.example_earth_subtitle));
    data.add(item);
-   activityMapping.put(i++, InflateActivity.class);
+   activityMapping.put(i++, EarthActivity.class);
    }
 
    final SimpleAdapter dataAdapter = new SimpleAdapter(this, data, R.layout.toc_item, new String[] {ITEM_IMAGE, ITEM_TITLE, ITEM_SUBTITLE}, new int[] {R.id.Image, R.id.Title, R.id.SubTitle});
diff --git a/src/main/java/org/distorted/examples/cubes/CubesActivity.java b/src/main/java/org/distorted/examples/cubes/CubesActivity.java
deleted file mode 100644
index 50413c0..0000000
--- a/src/main/java/org/distorted/examples/cubes/CubesActivity.java
+++ /dev/null
@@ -1,297 +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.cubes;
-
-import org.distorted.library.main.Distorted;
-import org.distorted.examples.R;
-import org.distorted.library.main.DistortedTexture;
-import org.distorted.library.mesh.MeshBase;
-import org.distorted.library.mesh.MeshCubes;
-
-import android.app.Activity;
-import android.opengl.GLSurfaceView;
-import android.os.Bundle;
-import android.view.Gravity;
-import android.view.View;
-import android.widget.AdapterView;
-import android.widget.ArrayAdapter;
-import android.widget.Button;
-import android.widget.LinearLayout;
-import android.widget.NumberPicker;
-import android.widget.NumberPicker.OnValueChangeListener;
-import android.widget.SeekBar;
-import android.widget.Spinner;
-import android.widget.TableRow;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-public class CubesActivity extends Activity implements View.OnClickListener, SeekBar.OnSeekBarChangeListener, AdapterView.OnItemSelectedListener
-{
-    private static final int COLOR_OFF = 0xffffe81f;
-    private static final int COLOR_ON  = 0xff0000ff;
-
-    private int mNumCols = 3;
-    private int mNumRows = 3;
-    private int mNumSlic = 1;
-    private NumberPicker mColsPicker, mRowsPicker, mSlicPicker;
-    private LinearLayout mLay;
-    private boolean[] mShape;
-    private DistortedTexture mTexture;
-    private MeshBase mMesh;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    @Override
-    protected void onCreate(Bundle savedState) 
-      {
-      super.onCreate(savedState);
-
-      setContentView(R.layout.cubespickerlayout);
-      
-      mLay = findViewById(R.id.cubespicker_buttongrid);
-      
-      mColsPicker = findViewById(R.id.cubespicker_cols);
-      mRowsPicker = findViewById(R.id.cubespicker_rows);
-      mSlicPicker = findViewById(R.id.cubespicker_slices);
-
-      mColsPicker.setMaxValue(40);
-      mColsPicker.setMinValue( 0);
-      mRowsPicker.setMaxValue(40);
-      mRowsPicker.setMinValue( 0);
-      mSlicPicker.setMaxValue(40);
-      mSlicPicker.setMinValue( 0);
-
-      mColsPicker.setOnValueChangedListener(new OnValueChangeListener() 
-         {
-         @Override
-         public void onValueChange(NumberPicker picker, int oldVal, int newVal) 
-           { 
-           setGrid();
-           }
-         });
-      
-      mRowsPicker.setOnValueChangedListener(new OnValueChangeListener() 
-         {
-         @Override
-         public void onValueChange(NumberPicker picker, int oldVal, int newVal) 
-           { 
-           setGrid();
-           }
-         });
-
-      mSlicPicker.setOnValueChangedListener(new OnValueChangeListener()
-         {
-         @Override
-         public void onValueChange(NumberPicker picker, int oldVal, int newVal)
-           {
-           mNumSlic = mSlicPicker.getValue();
-           }
-         });
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    private void setGrid()
-      {
-      mNumCols = mColsPicker.getValue();
-      mNumRows = mRowsPicker.getValue();
-      
-      int width = mLay.getWidth();
-      int height= mLay.getHeight();
-      int w = mNumCols>0 ? (int)( 0.9f*width / mNumCols) : 0;
-      int h = mNumRows>0 ? (int)( 0.9f*height/ mNumRows) : 0;
-      int size= w<h ? w:h;
-      int pad = size<20 ? 1 : size/20;
-     
-      mLay.removeAllViews();
-      
-      mShape = new boolean[mNumRows*mNumCols];
-
-      TableRow.LayoutParams p = new android.widget.TableRow.LayoutParams();
-
-      p.rightMargin  = pad;
-      p.leftMargin   = pad;
-      p.topMargin    = pad;
-      p.bottomMargin = pad;
-      p.height       = size;
-      p.width        = size;
-      
-      for (int rows=0; rows<mNumRows; rows++) 
-        {
-        TableRow tr = new TableRow(this);
-        tr.setGravity(Gravity.CENTER);
-        
-        for(int cols=0; cols<mNumCols; cols++) 
-          {
-          Button b = new Button(this);
-          b.setOnClickListener(this);
-          b.setId(rows*mNumCols+cols);
-          b.setLayoutParams(p);          
-          b.setBackgroundColor(COLOR_ON);
-          tr.addView(b, p);
-          mShape[rows*mNumCols+cols] = true;
-          }
-        
-        mLay.addView(tr);
-        }
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    public void onClick(View view) 
-      {
-      Button tmp = (Button)view;  
-      int id = tmp.getId();
-      mShape[id] = !mShape[id];
-      tmp.setBackgroundColor(mShape[id] ? COLOR_ON:COLOR_OFF);
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    @Override
-    public void onWindowFocusChanged(boolean hasFocus) 
-      {
-      super.onWindowFocusChanged(hasFocus);
-
-      mColsPicker.setValue(mNumCols);
-      mRowsPicker.setValue(mNumRows);
-      mSlicPicker.setValue(mNumSlic);
-
-      if( hasFocus ) setGrid();
-      }
-    
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    @Override
-    protected void onPause() 
-      {
-      GLSurfaceView mView = this.findViewById(R.id.cubesSurfaceView);
-      if( mView!=null ) mView.onPause();
-
-      Distorted.onPause();
-      super.onPause();
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    @Override
-    protected void onResume() 
-      {
-      super.onResume();
-      
-      GLSurfaceView mView = this.findViewById(R.id.cubesSurfaceView);
-      if( mView!=null ) mView.onResume();  
-      }
-    
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    @Override
-    protected void onDestroy() 
-      {
-      Distorted.onDestroy();  
-      super.onDestroy();
-      }
- 
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    public void Create(View v)
-      {
-      String str = "";
-
-      for(int i=0; i<mNumRows*mNumCols; i++)
-        str += mShape[i] ? "1" : "0";
-
-      mMesh = new MeshCubes(mNumCols, str, mNumSlic);
-      mTexture = new DistortedTexture(mNumCols,mNumRows);
-
-      setContentView(R.layout.cubeslayout);
-
-      Spinner renderSpinner  = findViewById(R.id.cubes_spinnerMode);
-      renderSpinner.setOnItemSelectedListener(this);
-
-      String[] objectBitmap = new String[] { "Render: Normal", "Render: OIT" };
-
-      ArrayAdapter<String> adapterBitmap = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, objectBitmap);
-      adapterBitmap.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
-      renderSpinner.setAdapter(adapterBitmap);
-
-      SeekBar transparencyBar = findViewById(R.id.cubesTransparency);
-
-      transparencyBar.setOnSeekBarChangeListener(this);
-
-      CubesSurfaceView view = this.findViewById(R.id.cubesSurfaceView);
-      view.getRenderer().setTransparency(50);
-      transparencyBar.setProgress(50);
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    public void onItemSelected(AdapterView<?> parent, View view, int pos, long id)
-      {
-      CubesSurfaceView v = this.findViewById(R.id.cubesSurfaceView);
-      CubesRenderer renderer = v.getRenderer();
-
-      switch(parent.getId())
-        {
-        case R.id.cubes_spinnerMode: renderer.setRenderModeToOIT(pos==1);
-                                     break;
-        }
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    public void onNothingSelected(AdapterView<?> parent)
-      {
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    public void onProgressChanged(SeekBar bar, int progress, boolean fromUser)
-      {
-      switch (bar.getId())
-        {
-        case R.id.cubesTransparency: CubesSurfaceView view = this.findViewById(R.id.cubesSurfaceView);
-                                     view.getRenderer().setTransparency(progress);
-                                     break;
-        }
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    public void onStartTrackingTouch(SeekBar bar) { }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    public void onStopTrackingTouch(SeekBar bar)  { }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    public DistortedTexture getTexture()
-      {
-      return mTexture;
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    public MeshBase getMesh()
-      {
-      return mMesh;
-      }
-}
diff --git a/src/main/java/org/distorted/examples/cubes/CubesRenderer.java b/src/main/java/org/distorted/examples/cubes/CubesRenderer.java
deleted file mode 100644
index 586b772..0000000
--- a/src/main/java/org/distorted/examples/cubes/CubesRenderer.java
+++ /dev/null
@@ -1,174 +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.cubes;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-
-import org.distorted.examples.R;
-
-import org.distorted.library.effect.FragmentEffectAlpha;
-import org.distorted.library.effect.MatrixEffectMove;
-import org.distorted.library.effect.MatrixEffectQuaternion;
-import org.distorted.library.effect.MatrixEffectScale;
-import org.distorted.library.main.DistortedEffects;
-import org.distorted.library.main.DistortedScreen;
-import org.distorted.library.main.DistortedTexture;
-import org.distorted.library.mesh.MeshBase;
-import org.distorted.library.type.DynamicQuat;
-import org.distorted.library.type.Static1D;
-import org.distorted.library.type.Static4D;
-import org.distorted.library.type.Static3D;
-import org.distorted.library.main.Distorted;
-
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.opengl.GLSurfaceView;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-class CubesRenderer implements GLSurfaceView.Renderer 
-{
-    private GLSurfaceView mView;
-    private DistortedTexture mTexture;
-    private DistortedEffects mEffects;
-    private MeshBase mMesh;
-    private DistortedScreen mScreen;
-    private int mObjWidth, mObjHeight, mObjDepth;
-    private Static3D mMove, mScale, mCenter;
-    private Static1D mAlpha;
-
-    Static4D mQuat1, mQuat2;
-    int mScreenMin;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    CubesRenderer(GLSurfaceView v)
-      {
-      mView = v;
-
-      mAlpha = new Static1D(1.0f);
-
-      mMove = new Static3D(0,0,0);
-      mScale= new Static3D(1,1,1);
-      mCenter=new Static3D(0,0,0);
-
-      CubesActivity act = (CubesActivity)v.getContext();
-
-      mTexture = act.getTexture();
-      mMesh = act.getMesh();
-
-      mObjWidth = mTexture.getWidth();
-      mObjHeight= mTexture.getHeight();
-      mObjDepth = mTexture.getDepth(mMesh);
-
-      mQuat1 = new Static4D(0,0,0,1);  // unity
-      mQuat2 = new Static4D(0,0,0,1);  // quaternions
-      
-      DynamicQuat quatInt1 = new DynamicQuat(0,0.5f);
-      DynamicQuat quatInt2 = new DynamicQuat(0,0.5f);
-
-      quatInt1.add(mQuat1);
-      quatInt2.add(mQuat2);
-
-      mEffects = new DistortedEffects();
-      mEffects.apply( new MatrixEffectMove(mMove) );
-      mEffects.apply( new MatrixEffectScale(mScale));
-      mEffects.apply( new MatrixEffectQuaternion(quatInt1, mCenter) );
-      mEffects.apply( new MatrixEffectQuaternion(quatInt2, mCenter) );
-      mEffects.apply( new FragmentEffectAlpha(mAlpha));
-
-      mScreen = new DistortedScreen();
-      mScreen.glClearColor(1.0f,1.0f,1.0f,0.0f);
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-   
-    public void onDrawFrame(GL10 glUnused) 
-      {
-      mScreen.render( System.currentTimeMillis() );
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    public void onSurfaceChanged(GL10 glUnused, int width, int height) 
-      {
-      mScreenMin = width<height ? width:height;
-      float factor = ( width*mObjHeight > height*mObjWidth ) ? (0.75f*height)/mObjHeight :  (0.75f*width)/mObjWidth;
-      mMove.set( (width-factor*mObjWidth)/2 , (height-factor*mObjHeight)/2 , 0);
-      mScale.set(factor,factor,factor);
-      mCenter.set( (float)mObjWidth/2, (float)mObjHeight/2, (float)mObjDepth/2 );
-      mScreen.resize(width, height);
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    void setRenderModeToOIT(boolean oit)
-      {
-      mScreen.setOrderIndependentTransparency(oit);
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    void setTransparency(int level)
-      {
-      mAlpha.set((float)level/100.0f);
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
-      {
-      InputStream is = mView.getContext().getResources().openRawResource(R.raw.grid);
-      Bitmap bitmap;
-        
-      try 
-        {
-        bitmap = BitmapFactory.decodeStream(is);
-        } 
-      finally 
-        {
-        try 
-          {
-          is.close();
-          } 
-        catch(IOException e) { }
-        }  
-      
-      mTexture.setTexture(bitmap);
-
-      mScreen.detachAll();
-      mScreen.attach(mTexture,mEffects,mMesh);
-
-      FragmentEffectAlpha.enable();
-
-      try
-        {
-        Distorted.onCreate(mView.getContext());
-        }
-      catch(Exception ex)
-        {
-        android.util.Log.e("Cubes", ex.getMessage() );
-        }
-      }
-}
diff --git a/src/main/java/org/distorted/examples/cubes/CubesSurfaceView.java b/src/main/java/org/distorted/examples/cubes/CubesSurfaceView.java
deleted file mode 100644
index 97d9a8d..0000000
--- a/src/main/java/org/distorted/examples/cubes/CubesSurfaceView.java
+++ /dev/null
@@ -1,139 +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.cubes;
-
-import org.distorted.examples.R;
-
-import android.app.ActivityManager;
-import android.content.Context;
-import android.content.pm.ConfigurationInfo;
-import android.opengl.GLSurfaceView;
-import android.util.AttributeSet;
-import android.view.MotionEvent;
-import android.widget.Toast;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-class CubesSurfaceView extends GLSurfaceView 
-{
-    private int mX, mY;
-    private CubesRenderer mRenderer;
-	
-///////////////////////////////////////////////////////////////////////////////////////////////////
-   
-    public CubesSurfaceView(Context context, AttributeSet attrs)
-      {
-      super(context,attrs);
-    
-      mX = -1;
-      mY = -1;
-      
-      if(!isInEditMode())
-        {
-        mRenderer = new CubesRenderer(this);
-        final ActivityManager activityManager     = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
-        final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
-        setEGLContextClientVersion( (configurationInfo.reqGlEsVersion>>16) >= 3 ? 3:2 );
-        setRenderer(mRenderer);
-        Toast.makeText(context, R.string.example_rotate_toast , Toast.LENGTH_SHORT).show();
-        }
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    public CubesRenderer getRenderer()
-      {
-      return mRenderer;
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    @Override public boolean onTouchEvent(MotionEvent event) 
-      {
-      int action = event.getAction();
-      int x = (int)event.getX();
-      int y = (int)event.getY();
-           
-      switch(action)
-         {
-         case MotionEvent.ACTION_DOWN: mX = x;
-                                       mY = y;
-                                       break;
-                                       
-         case MotionEvent.ACTION_MOVE: if( mX>=0 && mY>= 0 )
-                                         {
-                                         float px = mY-y;
-                                         float py = mX-x;
-                                         float pz = 0;
-                                         float plen = (float)Math.sqrt(px*px + py*py + pz*pz);
-                                         
-                                         if( plen>0 )
-                                           {
-                                           px /= plen;
-                                           py /= plen;
-                                           pz /= plen;
-
-                                           float cosA = (float)Math.cos(plen*3.14f/mRenderer.mScreenMin);
-                                           float sinA = (float)Math.sqrt(1-cosA*cosA);
-                                         
-                                           mRenderer.mQuat1.set(px*sinA, py*sinA, pz*sinA, cosA);
-                                           }
-                                         }                             
-                                       break;
-                                       
-         case MotionEvent.ACTION_UP  : mX = -1;
-                                       mY = -1;
-        	                           
-                                       float qx = mRenderer.mQuat1.get1();
-                                       float qy = mRenderer.mQuat1.get2();
-                                       float qz = mRenderer.mQuat1.get3();
-                                       float qw = mRenderer.mQuat1.get4();
-
-                                       float rx = mRenderer.mQuat2.get1();
-                                       float ry = mRenderer.mQuat2.get2();
-                                       float rz = mRenderer.mQuat2.get3();
-                                       float rw = mRenderer.mQuat2.get4();
-
-                                       // This is quaternion multiplication. (tx,ty,tz,tw)
-                                       // is now equal to (qx,qy,qz,qw)*(rx,ry,rz,rw)
-                                       float tx = rw*qx - rz*qy + ry*qz + rx*qw;
-                                       float ty = rw*qy + rz*qx + ry*qw - rx*qz;
-                                       float tz = rw*qz + rz*qw - ry*qx + rx*qy;
-                                       float tw = rw*qw - rz*qz - ry*qy - rx*qx;
-
-                                       // The point of this is so that there are always
-                                       // exactly 2 quaternions: Quat1 representing the rotation
-                                       // accumulating only since the last screen touch, and Quat2
-                                       // which remembers the combined effect of all previous
-                                       // swipes.
-                                       // We cannot be accumulating an ever-growing list of quaternions
-                                       // and add a new one every time user swipes the screen - there
-                                       // is a limited number of slots in the EffectQueueMatrix!
-                                       mRenderer.mQuat1.set(0f, 0f, 0f, 1f);
-                                       mRenderer.mQuat2.set(tx, ty, tz, tw);
-                                       
-                                       break;
-         }
-             
-      return true;
-      }
-         
-}
-
diff --git a/src/main/java/org/distorted/examples/earth/EarthActivity.java b/src/main/java/org/distorted/examples/earth/EarthActivity.java
new file mode 100644
index 0000000..125c946
--- /dev/null
+++ b/src/main/java/org/distorted/examples/earth/EarthActivity.java
@@ -0,0 +1,325 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// 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.earth;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.Gravity;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.LinearLayout;
+import android.widget.NumberPicker;
+import android.widget.Spinner;
+import android.widget.TableRow;
+
+import org.distorted.examples.R;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+public class EarthActivity extends Activity
+                               implements View.OnClickListener, AdapterView.OnItemSelectedListener
+  {
+  private static final int COLOR_OFF = 0xffffe81f;
+  private static final int COLOR_ON  = 0xff0000ff;
+  private static final int COLOR_INAC= 0xff999999;
+
+  private int mNumCols = 1;
+  private int mNumRows = 1;
+  private int mNumSlic = 1;
+  private boolean mGridInitialized;
+  private NumberPicker mColsPicker, mRowsPicker, mSlicPicker;
+  private boolean[] mShape;
+  private int mObjectType;
+  private int mBitmapID;
+  private LinearLayout mLay;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  @Override
+  protected void onCreate(Bundle savedState)
+    {
+    super.onCreate(savedState);
+
+    setContentView(R.layout.objectpickerlayout);
+
+    mLay = findViewById(R.id.objectpicker_buttongrid);
+
+    mColsPicker = findViewById(R.id.objectpicker_cols);
+    mRowsPicker = findViewById(R.id.objectpicker_rows);
+    mSlicPicker = findViewById(R.id.objectpicker_slices);
+
+    mColsPicker.setMaxValue(40);
+    mColsPicker.setMinValue( 1);
+    mRowsPicker.setMaxValue(40);
+    mRowsPicker.setMinValue( 1);
+    mSlicPicker.setMaxValue(40);
+    mSlicPicker.setMinValue( 0);
+
+    mColsPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
+         {
+         @Override
+         public void onValueChange(NumberPicker picker, int oldVal, int newVal)
+           {
+           setGrid();
+           }
+         });
+
+    mRowsPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
+         {
+         @Override
+         public void onValueChange(NumberPicker picker, int oldVal, int newVal)
+           {
+           setGrid();
+           }
+         });
+
+    mSlicPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
+         {
+         @Override
+         public void onValueChange(NumberPicker picker, int oldVal, int newVal)
+           {
+           mNumSlic = mSlicPicker.getValue();
+           }
+         });
+
+    mObjectType = 0;
+    mGridInitialized = false;
+
+    Spinner typeSpinner  = findViewById(R.id.objectpicker_spinnerType);
+    typeSpinner.setOnItemSelectedListener(this);
+
+    String[] objectType = new String[] {"Mesh: Cubes", "Mesh: Flat", "Mesh: Sphere", "Mesh: Quad"};
+
+    ArrayAdapter<String> adapterType = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, objectType);
+    adapterType.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+    typeSpinner.setAdapter(adapterType);
+
+    Spinner bitmapSpinner  = findViewById(R.id.objectpicker_spinnerBitmap);
+    bitmapSpinner.setOnItemSelectedListener(this);
+
+    String[] objectBitmap = new String[] { "Texture: Grid", "Texture: Girl", "Texture: Dog", "Texture: Cat",
+                                           "Texture: Squares", "Texture: Bean", "Texture: Lisa", "Texture: World" };
+
+    ArrayAdapter<String> adapterBitmap = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, objectBitmap);
+    adapterBitmap.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+    bitmapSpinner.setAdapter(adapterBitmap);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void setGrid()
+    {
+    mGridInitialized = true;
+
+    mNumCols = mColsPicker.getValue();
+    mNumRows = mRowsPicker.getValue();
+
+    int width = mLay.getWidth();
+    int height= mLay.getHeight();
+    int w = mNumCols>0 ? (int)( 0.9f*width / mNumCols) : 0;
+    int h = mNumRows>0 ? (int)( 0.9f*height/ mNumRows) : 0;
+    int size= w<h ? w:h;
+    int pad = size<20 ? 1 : size/20;
+
+    mLay.removeAllViews();
+
+    mShape = new boolean[mNumRows*mNumCols];
+
+    TableRow.LayoutParams p = new TableRow.LayoutParams();
+
+    p.rightMargin  = pad;
+    p.leftMargin   = pad;
+    p.topMargin    = pad;
+    p.bottomMargin = pad;
+    p.height       = size;
+    p.width        = size;
+
+    for (int rows=0; rows<mNumRows; rows++)
+      {
+      TableRow tr = new TableRow(this);
+      tr.setGravity(Gravity.CENTER);
+
+      for(int cols=0; cols<mNumCols; cols++)
+        {
+        Button b = new Button(this);
+        b.setOnClickListener(this);
+        b.setId(rows*mNumCols+cols);
+        b.setLayoutParams(p);
+        b.setBackgroundColor(mObjectType==0 ? COLOR_ON:COLOR_INAC);
+        tr.addView(b, p);
+        mShape[rows*mNumCols+cols] = true;
+        }
+
+      mLay.addView(tr);
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void onClick(View view)
+    {
+    if( mObjectType==0 )  // cubes
+      {
+      Button tmp = (Button)view;
+      int id = tmp.getId();
+      mShape[id] = !mShape[id];
+      tmp.setBackgroundColor(mShape[id] ? COLOR_ON:COLOR_OFF);
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void uncheckAll()
+    {
+    TableRow tr;
+    Button butt;
+
+    for (int row=0; row<mNumRows; row++)
+      {
+      tr = (TableRow)mLay.getChildAt(row);
+
+      for(int col=0; col<mNumCols; col++)
+        {
+        butt = (Button)tr.getVirtualChildAt(col);
+        butt.setBackgroundColor(mObjectType==0 ? COLOR_ON : COLOR_INAC);
+        mShape[row*mNumCols+col] = true;
+        }
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void Create(View v)
+    {
+    Intent mainInt = new Intent( getApplicationContext(), EarthActivity2.class);
+    Bundle b = new Bundle();
+
+    int rows=0, cols=0;
+
+    switch(mObjectType)
+      {
+      case 0:
+      case 1: rows = mNumRows;
+              cols = mNumCols;
+              break;
+      case 2: rows = mNumRows;   // always make the sphere equal in X and Y
+              cols = mNumRows;   //
+              break;
+      case 3: rows = 1;          // a quad is always 1x1
+              cols = 1;
+              break;
+      }
+
+    b.putInt("type", mObjectType);
+    b.putInt("cols", cols);
+    b.putInt("rows", rows);
+    b.putInt("slices", mNumSlic);
+    b.putInt("bitmap", mBitmapID);
+
+    if( mObjectType==0 )   // cubes
+      {
+      String str = "";
+
+      for(int i=0; i<mNumRows*mNumCols; i++)
+        str += mShape[i] ? "1" : "0";
+
+      b.putString("string", str);
+      }
+    else
+      {
+      b.putString("string", "");
+      }
+
+    mainInt.putExtras(b);
+    startActivity(mainInt);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void onItemSelected(AdapterView<?> parent, View view, int pos, long id)
+    {
+    switch(parent.getId())
+      {
+      case R.id.objectpicker_spinnerType  : if( mObjectType!=pos )
+                                              {
+                                              mObjectType = pos;
+                                              uncheckAll();
+
+                                              switch(mObjectType)
+                                                {
+                                                case 0: mColsPicker.setEnabled(true);
+                                                        mRowsPicker.setEnabled(true);
+                                                        mSlicPicker.setEnabled(true);
+                                                        break;
+                                                case 1: mColsPicker.setEnabled(true);
+                                                        mRowsPicker.setEnabled(true);
+                                                        mSlicPicker.setEnabled(false);
+                                                        break;
+                                                case 2: mColsPicker.setEnabled(false);
+                                                        mRowsPicker.setEnabled(true);
+                                                        mSlicPicker.setEnabled(false);
+                                                        break;
+                                                case 3: mColsPicker.setEnabled(false);
+                                                        mRowsPicker.setEnabled(false);
+                                                        mSlicPicker.setEnabled(false);
+                                                        break;
+                                                }
+                                              }
+                                            break;
+      case R.id.objectpicker_spinnerBitmap: switch(pos)
+                                              {
+                                              case 0: mBitmapID = -1            ; break;
+                                              case 1: mBitmapID = R.raw.face    ; break;
+                                              case 2: mBitmapID = R.raw.dog     ; break;
+                                              case 3: mBitmapID = R.raw.cat     ; break;
+                                              case 4: mBitmapID = R.raw.grid    ; break;
+                                              case 5: mBitmapID = R.raw.bean    ; break;
+                                              case 6: mBitmapID = R.raw.monalisa; break;
+                                              case 7: mBitmapID = R.raw.world   ; break;
+                                              }
+                                            break;
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void onNothingSelected(AdapterView<?> parent)
+    {
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Overrides
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  @Override
+  public void onWindowFocusChanged(boolean hasFocus)
+    {
+    super.onWindowFocusChanged(hasFocus);
+
+    mColsPicker.setValue(mNumCols);
+    mRowsPicker.setValue(mNumRows);
+    mSlicPicker.setValue(mNumSlic);
+
+    if( !mGridInitialized ) setGrid();
+    }
+  }
diff --git a/src/main/java/org/distorted/examples/earth/EarthActivity2.java b/src/main/java/org/distorted/examples/earth/EarthActivity2.java
new file mode 100644
index 0000000..7125b32
--- /dev/null
+++ b/src/main/java/org/distorted/examples/earth/EarthActivity2.java
@@ -0,0 +1,208 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// 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.earth;
+
+import android.app.Activity;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.opengl.GLSurfaceView;
+import android.os.Bundle;
+import android.widget.SeekBar;
+import android.widget.TextView;
+
+import org.distorted.examples.R;
+import org.distorted.library.main.Distorted;
+import org.distorted.library.main.DistortedTexture;
+import org.distorted.library.mesh.MeshBase;
+import org.distorted.library.mesh.MeshCubes;
+import org.distorted.library.mesh.MeshFlat;
+import org.distorted.library.mesh.MeshQuad;
+import org.distorted.library.mesh.MeshSphere;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+public class EarthActivity2 extends Activity implements SeekBar.OnSeekBarChangeListener
+{
+    private DistortedTexture mTexture;
+    private MeshBase mMesh;
+    private TextView mTextLevel;
+    private int mBitmapID;
+    private Bitmap mBitmap;
+    private int mNumCols;
+    private int mNumRows;
+    private int mNumSlic;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+    @Override
+    protected void onPause() 
+      {
+      GLSurfaceView mView = this.findViewById(R.id.earthSurfaceView);
+      if( mView!=null ) mView.onPause();
+
+      Distorted.onPause();
+      super.onPause();
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+    @Override
+    protected void onResume() 
+      {
+      super.onResume();
+      
+      GLSurfaceView mView = this.findViewById(R.id.earthSurfaceView);
+      if( mView!=null ) mView.onResume();  
+      }
+    
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+    @Override
+    protected void onDestroy() 
+      {
+      Distorted.onDestroy();  
+      super.onDestroy();
+      }
+ 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    @Override
+    protected void onCreate(Bundle savedState)
+      {
+      super.onCreate(savedState);
+
+      Bundle b = getIntent().getExtras();
+
+      String str     = b.getString("string");
+      int objectType = b.getInt("type");
+      mNumCols       = b.getInt("cols");
+      mNumRows       = b.getInt("rows");
+      mNumSlic       = b.getInt("slices");
+      mBitmapID      = b.getInt("bitmap");
+
+      switch(objectType)
+        {
+        case 0: mMesh = new MeshCubes(mNumCols, str, mNumSlic);
+                break;
+        case 1: mMesh = new MeshFlat(mNumCols,mNumRows);
+                break;
+        case 2: mMesh = new MeshSphere(mNumRows);
+                break;
+        case 3: mMesh = new MeshQuad();
+                break;
+        }
+
+      mTexture= new DistortedTexture(mNumCols,mNumRows);
+
+      setContentView(R.layout.earthlayout);
+
+      mTextLevel = findViewById(R.id.earthInflateText);
+      SeekBar levelBar = findViewById(R.id.earthInflateLevel);
+      levelBar.setOnSeekBarChangeListener(this);
+      levelBar.setProgress(50);
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    public Bitmap getBitmap()
+      {
+      if( mBitmap==null )
+        {
+        if( mBitmapID!=-1)
+          {
+          InputStream is = getResources().openRawResource(mBitmapID);
+
+          try
+            {
+            mBitmap = BitmapFactory.decodeStream(is);
+            }
+          finally
+            {
+            try
+              {
+              is.close();
+              }
+            catch(IOException e) { }
+            }
+          }
+        else
+          {
+          final int W = 64*mNumCols;
+          final int H = 64*mNumRows;
+
+          Paint paint = new Paint();
+          mBitmap = Bitmap.createBitmap(W,H, Bitmap.Config.ARGB_8888);
+          Canvas canvas = new Canvas(mBitmap);
+
+          paint.setAntiAlias(true);
+          paint.setTextAlign(Paint.Align.CENTER);
+          paint.setColor(0xff008800);
+          paint.setStyle(Paint.Style.FILL);
+          canvas.drawRect(0, 0, W, H, paint);
+          paint.setColor(0xffffffff);
+
+          for(int i=0; i<=mNumCols ; i++ ) canvas.drawRect(W*i/mNumCols-1, 0, W*i/mNumCols + 1, H, paint);
+          for(int i=0; i<=mNumRows ; i++ ) canvas.drawRect( 0, H*i/mNumRows-1, W,  H*i/mNumRows+1, paint);
+          }
+        }
+
+      return mBitmap;
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    public void onProgressChanged(SeekBar bar, int progress, boolean fromUser)
+      {
+      switch (bar.getId())
+        {
+        case R.id.earthInflateLevel: EarthSurfaceView view = this.findViewById(R.id.earthSurfaceView);
+                                     float level = view.getRenderer().setLevel(progress);
+                                     mTextLevel.setText(getString(R.string.inflate_placeholder, level));
+                                     break;
+        }
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    public void onStartTrackingTouch(SeekBar bar) { }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    public void onStopTrackingTouch(SeekBar bar)  { }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    public DistortedTexture getTexture()
+      {
+      return mTexture;
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    public MeshBase getMesh()
+      {
+      return mMesh;
+      }
+}
diff --git a/src/main/java/org/distorted/examples/earth/EarthRenderer.java b/src/main/java/org/distorted/examples/earth/EarthRenderer.java
new file mode 100644
index 0000000..8998660
--- /dev/null
+++ b/src/main/java/org/distorted/examples/earth/EarthRenderer.java
@@ -0,0 +1,147 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// 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.earth;
+
+import android.opengl.GLSurfaceView;
+
+import org.distorted.library.effect.MatrixEffectMove;
+import org.distorted.library.effect.MatrixEffectQuaternion;
+import org.distorted.library.effect.MatrixEffectScale;
+import org.distorted.library.main.Distorted;
+import org.distorted.library.main.DistortedEffects;
+import org.distorted.library.main.DistortedScreen;
+import org.distorted.library.main.DistortedTexture;
+import org.distorted.library.mesh.MeshBase;
+import org.distorted.library.type.DynamicQuat;
+import org.distorted.library.type.Static3D;
+import org.distorted.library.type.Static4D;
+
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.opengles.GL10;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class EarthRenderer implements GLSurfaceView.Renderer
+{
+    private static final float FOV = 30.0f;
+    private static final float NEAR = 0.1f;
+
+    private GLSurfaceView mView;
+    private DistortedTexture mTexture;
+    private DistortedEffects mEffects;
+    private MeshBase mMesh;
+    private DistortedScreen mScreen;
+    private int mObjWidth, mObjHeight, mObjDepth;
+    private Static3D mMove, mScale, mCenter;
+
+    Static4D mQuat1, mQuat2;
+    int mScreenMin;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    EarthRenderer(GLSurfaceView v)
+      {
+      mView = v;
+
+      mMove = new Static3D(0,0,0);
+      mScale= new Static3D(1,1,1);
+      mCenter=new Static3D(0,0,0);
+
+      EarthActivity2 act = (EarthActivity2)v.getContext();
+
+      mTexture = act.getTexture();
+      mMesh    = act.getMesh();
+
+      mObjWidth = mTexture.getWidth();
+      mObjHeight= mTexture.getHeight();
+      mObjDepth = mTexture.getDepth(mMesh);
+
+      mQuat1 = new Static4D(0,0,0,1);  // unity
+      mQuat2 = new Static4D(0,0,0,1);  // quaternions
+      
+      DynamicQuat quatInt1 = new DynamicQuat(0,0.5f);
+      DynamicQuat quatInt2 = new DynamicQuat(0,0.5f);
+
+      quatInt1.add(mQuat1);
+      quatInt2.add(mQuat2);
+
+      mEffects = new DistortedEffects();
+      mEffects.apply( new MatrixEffectMove(mMove) );
+      mEffects.apply( new MatrixEffectScale(mScale));
+      mEffects.apply( new MatrixEffectQuaternion(quatInt1, mCenter) );
+      mEffects.apply( new MatrixEffectQuaternion(quatInt2, mCenter) );
+
+      mScreen = new DistortedScreen();
+      mScreen.glClearColor(1.0f,1.0f,1.0f,0.0f);
+      mScreen.setProjection(FOV, NEAR);
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+   
+    public void onDrawFrame(GL10 glUnused) 
+      {
+      mScreen.render( System.currentTimeMillis() );
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+    public void onSurfaceChanged(GL10 glUnused, int width, int height) 
+      {
+      final float SCALE = 0.75f;
+
+      mScreenMin = width<height ? width:height;
+      float factor = ( width*mObjHeight > height*mObjWidth ) ? (SCALE*height)/mObjHeight :  (SCALE*width)/mObjWidth;
+      mMove.set( (width-factor*mObjWidth)/2 , (height-factor*mObjHeight)/2 , 0);
+      mScale.set(factor,factor,factor);
+      mCenter.set( (float)mObjWidth/2, (float)mObjHeight/2, (float)mObjDepth/2 );
+      mScreen.resize(width, height);
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    float setLevel(int level)
+      {
+      float inflateLevel = (level-50)/50.0f;
+      mMesh.setInflate(inflateLevel);
+
+      return inflateLevel;
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
+      {
+      EarthActivity2 act = (EarthActivity2)mView.getContext();
+
+      mTexture.setTexture( act.getBitmap() );
+
+      mScreen.detachAll();
+      mScreen.attach(mTexture,mEffects,mMesh);
+
+      try
+        {
+        Distorted.onCreate(mView.getContext());
+        }
+      catch(Exception ex)
+        {
+        android.util.Log.e("Earth", ex.getMessage() );
+        }
+      }
+}
diff --git a/src/main/java/org/distorted/examples/earth/EarthSurfaceView.java b/src/main/java/org/distorted/examples/earth/EarthSurfaceView.java
new file mode 100644
index 0000000..107a7f8
--- /dev/null
+++ b/src/main/java/org/distorted/examples/earth/EarthSurfaceView.java
@@ -0,0 +1,139 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// 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.earth;
+
+import android.app.ActivityManager;
+import android.content.Context;
+import android.content.pm.ConfigurationInfo;
+import android.opengl.GLSurfaceView;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.widget.Toast;
+
+import org.distorted.examples.R;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class EarthSurfaceView extends GLSurfaceView
+{
+    private int mX, mY;
+    private EarthRenderer mRenderer;
+	
+///////////////////////////////////////////////////////////////////////////////////////////////////
+   
+    public EarthSurfaceView(Context context, AttributeSet attrs)
+      {
+      super(context,attrs);
+    
+      mX = -1;
+      mY = -1;
+      
+      if(!isInEditMode())
+        {
+        mRenderer = new EarthRenderer(this);
+        final ActivityManager activityManager     = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
+        final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
+        setEGLContextClientVersion( (configurationInfo.reqGlEsVersion>>16) >= 3 ? 3:2 );
+        setRenderer(mRenderer);
+        Toast.makeText(context, R.string.example_rotate_toast , Toast.LENGTH_SHORT).show();
+        }
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    public EarthRenderer getRenderer()
+      {
+      return mRenderer;
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+    @Override public boolean onTouchEvent(MotionEvent event) 
+      {
+      int action = event.getAction();
+      int x = (int)event.getX();
+      int y = (int)event.getY();
+           
+      switch(action)
+         {
+         case MotionEvent.ACTION_DOWN: mX = x;
+                                       mY = y;
+                                       break;
+                                       
+         case MotionEvent.ACTION_MOVE: if( mX>=0 && mY>= 0 )
+                                         {
+                                         float px = mY-y;
+                                         float py = mX-x;
+                                         float pz = 0;
+                                         float plen = (float)Math.sqrt(px*px + py*py + pz*pz);
+                                         
+                                         if( plen>0 )
+                                           {
+                                           px /= plen;
+                                           py /= plen;
+                                           pz /= plen;
+
+                                           float cosA = (float)Math.cos(plen*3.14f/mRenderer.mScreenMin);
+                                           float sinA = (float)Math.sqrt(1-cosA*cosA);
+                                         
+                                           mRenderer.mQuat1.set(px*sinA, py*sinA, pz*sinA, cosA);
+                                           }
+                                         }                             
+                                       break;
+                                       
+         case MotionEvent.ACTION_UP  : mX = -1;
+                                       mY = -1;
+        	                           
+                                       float qx = mRenderer.mQuat1.get1();
+                                       float qy = mRenderer.mQuat1.get2();
+                                       float qz = mRenderer.mQuat1.get3();
+                                       float qw = mRenderer.mQuat1.get4();
+
+                                       float rx = mRenderer.mQuat2.get1();
+                                       float ry = mRenderer.mQuat2.get2();
+                                       float rz = mRenderer.mQuat2.get3();
+                                       float rw = mRenderer.mQuat2.get4();
+
+                                       // This is quaternion multiplication. (tx,ty,tz,tw)
+                                       // is now equal to (qx,qy,qz,qw)*(rx,ry,rz,rw)
+                                       float tx = rw*qx - rz*qy + ry*qz + rx*qw;
+                                       float ty = rw*qy + rz*qx + ry*qw - rx*qz;
+                                       float tz = rw*qz + rz*qw - ry*qx + rx*qy;
+                                       float tw = rw*qw - rz*qz - ry*qy - rx*qx;
+
+                                       // The point of this is so that there are always
+                                       // exactly 2 quaternions: Quat1 representing the rotation
+                                       // accumulating only since the last screen touch, and Quat2
+                                       // which remembers the combined effect of all previous
+                                       // swipes.
+                                       // We cannot be accumulating an ever-growing list of quaternions
+                                       // and add a new one every time user swipes the screen - there
+                                       // is a limited number of slots in the EffectQueueMatrix!
+                                       mRenderer.mQuat1.set(0f, 0f, 0f, 1f);
+                                       mRenderer.mQuat2.set(tx, ty, tz, tw);
+                                       
+                                       break;
+         }
+             
+      return true;
+      }
+         
+}
+
diff --git a/src/main/java/org/distorted/examples/inflate/InflateActivity2.java b/src/main/java/org/distorted/examples/inflate/InflateActivity2.java
index e50d864..24df472 100644
--- a/src/main/java/org/distorted/examples/inflate/InflateActivity2.java
+++ b/src/main/java/org/distorted/examples/inflate/InflateActivity2.java
@@ -19,6 +19,15 @@
 
 package org.distorted.examples.inflate;
 
+import org.distorted.library.main.Distorted;
+import org.distorted.examples.R;
+import org.distorted.library.main.DistortedTexture;
+import org.distorted.library.mesh.MeshBase;
+import org.distorted.library.mesh.MeshCubes;
+import org.distorted.library.mesh.MeshFlat;
+import org.distorted.library.mesh.MeshQuad;
+import org.distorted.library.mesh.MeshSphere;
+
 import android.app.Activity;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
@@ -26,33 +35,28 @@ import android.graphics.Canvas;
 import android.graphics.Paint;
 import android.opengl.GLSurfaceView;
 import android.os.Bundle;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
 import android.widget.SeekBar;
+import android.widget.Spinner;
 import android.widget.TextView;
 
-import org.distorted.examples.R;
-import org.distorted.library.main.Distorted;
-import org.distorted.library.main.DistortedTexture;
-import org.distorted.library.mesh.MeshBase;
-import org.distorted.library.mesh.MeshCubes;
-import org.distorted.library.mesh.MeshFlat;
-import org.distorted.library.mesh.MeshQuad;
-import org.distorted.library.mesh.MeshSphere;
-
 import java.io.IOException;
 import java.io.InputStream;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-public class InflateActivity2 extends Activity implements SeekBar.OnSeekBarChangeListener
+public class InflateActivity2 extends Activity implements SeekBar.OnSeekBarChangeListener, AdapterView.OnItemSelectedListener
 {
-    private DistortedTexture mTexture;
-    private MeshBase mMesh;
-    private TextView mTextLevel;
+    private int mNumCols = 3;
+    private int mNumRows = 3;
+    private int mNumSlic = 1;
     private int mBitmapID;
     private Bitmap mBitmap;
-    private int mNumCols;
-    private int mNumRows;
-    private int mNumSlic;
+    private TextView mTextLevel;
+    private DistortedTexture mTexture;
+    private MeshBase mMesh;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
     
@@ -85,7 +89,7 @@ public class InflateActivity2 extends Activity implements SeekBar.OnSeekBarChang
       Distorted.onDestroy();  
       super.onDestroy();
       }
- 
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
     @Override
@@ -105,29 +109,38 @@ public class InflateActivity2 extends Activity implements SeekBar.OnSeekBarChang
       switch(objectType)
         {
         case 0: mMesh = new MeshCubes(mNumCols, str, mNumSlic);
-                break;
+          break;
         case 1: mMesh = new MeshFlat(mNumCols,mNumRows);
-                break;
+          break;
         case 2: mMesh = new MeshSphere(mNumRows);
-                break;
+          break;
         case 3: mMesh = new MeshQuad();
-                break;
+          break;
         }
 
-      mTexture= new DistortedTexture(mNumCols,mNumRows);
+      mTexture = new DistortedTexture(mNumCols,mNumRows);
 
       setContentView(R.layout.inflatelayout);
 
-      mTextLevel = findViewById(R.id.inflateText);
-      SeekBar levelBar = findViewById(R.id.inflateLevel);
-      levelBar.setOnSeekBarChangeListener(this);
+      Spinner renderSpinner  = findViewById(R.id.inflateSpinnerMode);
+      renderSpinner.setOnItemSelectedListener(this);
 
-      InflateSurfaceView view = this.findViewById(R.id.inflateSurfaceView);
-      float level = view.getRenderer().setLevel(50);
-      mTextLevel.setText(getString(R.string.inflate_placeholder, level));
-      levelBar.setProgress(50);
-      }
+      String[] objectBitmap = new String[] { "Render: Normal", "Render: OIT" };
+
+      ArrayAdapter<String> adapterBitmap = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, objectBitmap);
+      adapterBitmap.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+      renderSpinner.setAdapter(adapterBitmap);
+
+      mTextLevel = findViewById(R.id.inflateInflateText);
 
+      SeekBar transparencyBar = findViewById(R.id.inflateTransparency);
+      transparencyBar.setOnSeekBarChangeListener(this);
+      transparencyBar.setProgress(50);
+
+      SeekBar inflateBar = findViewById(R.id.inflateInflateLevel);
+      inflateBar.setOnSeekBarChangeListener(this);
+      inflateBar.setProgress(50);
+      }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -176,16 +189,39 @@ public class InflateActivity2 extends Activity implements SeekBar.OnSeekBarChang
       return mBitmap;
       }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    public void onItemSelected(AdapterView<?> parent, View view, int pos, long id)
+      {
+      InflateSurfaceView v = this.findViewById(R.id.inflateSurfaceView);
+      InflateRenderer renderer = v.getRenderer();
+
+      switch(parent.getId())
+        {
+        case R.id.inflateSpinnerMode: renderer.setRenderModeToOIT(pos==1);
+                                      break;
+        }
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    public void onNothingSelected(AdapterView<?> parent)
+      {
+      }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
     public void onProgressChanged(SeekBar bar, int progress, boolean fromUser)
       {
       switch (bar.getId())
         {
-        case R.id.inflateLevel: InflateSurfaceView view = this.findViewById(R.id.inflateSurfaceView);
-                                float level = view.getRenderer().setLevel(progress);
-                                mTextLevel.setText(getString(R.string.inflate_placeholder, level));
-                                break;
+        case R.id.inflateTransparency: InflateSurfaceView v1 = this.findViewById(R.id.inflateSurfaceView);
+                                       v1.getRenderer().setTransparency(progress);
+                                       break;
+        case R.id.inflateInflateLevel: InflateSurfaceView v2 = this.findViewById(R.id.inflateSurfaceView);
+                                       float level = v2.getRenderer().setLevel(progress);
+                                       mTextLevel.setText(getString(R.string.inflate_placeholder, level));
+                                       break;
         }
       }
 
diff --git a/src/main/java/org/distorted/examples/inflate/InflateRenderer.java b/src/main/java/org/distorted/examples/inflate/InflateRenderer.java
index 5306cff..0043014 100644
--- a/src/main/java/org/distorted/examples/inflate/InflateRenderer.java
+++ b/src/main/java/org/distorted/examples/inflate/InflateRenderer.java
@@ -19,22 +19,24 @@
 
 package org.distorted.examples.inflate;
 
-import android.opengl.GLSurfaceView;
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.opengles.GL10;
 
+import org.distorted.library.effect.FragmentEffectAlpha;
 import org.distorted.library.effect.MatrixEffectMove;
 import org.distorted.library.effect.MatrixEffectQuaternion;
 import org.distorted.library.effect.MatrixEffectScale;
-import org.distorted.library.main.Distorted;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedScreen;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshBase;
 import org.distorted.library.type.DynamicQuat;
-import org.distorted.library.type.Static3D;
+import org.distorted.library.type.Static1D;
 import org.distorted.library.type.Static4D;
+import org.distorted.library.type.Static3D;
+import org.distorted.library.main.Distorted;
 
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
+import android.opengl.GLSurfaceView;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -50,6 +52,7 @@ class InflateRenderer implements GLSurfaceView.Renderer
     private DistortedScreen mScreen;
     private int mObjWidth, mObjHeight, mObjDepth;
     private Static3D mMove, mScale, mCenter;
+    private Static1D mAlpha;
 
     Static4D mQuat1, mQuat2;
     int mScreenMin;
@@ -60,6 +63,8 @@ class InflateRenderer implements GLSurfaceView.Renderer
       {
       mView = v;
 
+      mAlpha = new Static1D(1.0f);
+
       mMove = new Static3D(0,0,0);
       mScale= new Static3D(1,1,1);
       mCenter=new Static3D(0,0,0);
@@ -67,7 +72,7 @@ class InflateRenderer implements GLSurfaceView.Renderer
       InflateActivity2 act = (InflateActivity2)v.getContext();
 
       mTexture = act.getTexture();
-      mMesh    = act.getMesh();
+      mMesh = act.getMesh();
 
       mObjWidth = mTexture.getWidth();
       mObjHeight= mTexture.getHeight();
@@ -87,6 +92,7 @@ class InflateRenderer implements GLSurfaceView.Renderer
       mEffects.apply( new MatrixEffectScale(mScale));
       mEffects.apply( new MatrixEffectQuaternion(quatInt1, mCenter) );
       mEffects.apply( new MatrixEffectQuaternion(quatInt2, mCenter) );
+      mEffects.apply( new FragmentEffectAlpha(mAlpha));
 
       mScreen = new DistortedScreen();
       mScreen.glClearColor(1.0f,1.0f,1.0f,0.0f);
@@ -104,16 +110,28 @@ class InflateRenderer implements GLSurfaceView.Renderer
     
     public void onSurfaceChanged(GL10 glUnused, int width, int height) 
       {
-      final float SCALE = 0.75f;
-
       mScreenMin = width<height ? width:height;
-      float factor = ( width*mObjHeight > height*mObjWidth ) ? (SCALE*height)/mObjHeight :  (SCALE*width)/mObjWidth;
+      float factor = ( width*mObjHeight > height*mObjWidth ) ? (0.75f*height)/mObjHeight :  (0.75f*width)/mObjWidth;
       mMove.set( (width-factor*mObjWidth)/2 , (height-factor*mObjHeight)/2 , 0);
       mScale.set(factor,factor,factor);
       mCenter.set( (float)mObjWidth/2, (float)mObjHeight/2, (float)mObjDepth/2 );
       mScreen.resize(width, height);
       }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    void setRenderModeToOIT(boolean oit)
+      {
+      mScreen.setOrderIndependentTransparency(oit);
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    void setTransparency(int level)
+      {
+      mAlpha.set((float)level/100.0f);
+      }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
     float setLevel(int level)
@@ -131,13 +149,14 @@ class InflateRenderer implements GLSurfaceView.Renderer
       InflateActivity2 act = (InflateActivity2)mView.getContext();
 
       mTexture.setTexture( act.getBitmap() );
-
       mScreen.detachAll();
       mScreen.attach(mTexture,mEffects,mMesh);
 
+      FragmentEffectAlpha.enable();
+
       try
         {
-        Distorted.onCreate(mView.getContext());
+        Distorted.onCreate(act);
         }
       catch(Exception ex)
         {
diff --git a/src/main/java/org/distorted/examples/inflate/InflateSurfaceView.java b/src/main/java/org/distorted/examples/inflate/InflateSurfaceView.java
index 4501911..c1efdbd 100644
--- a/src/main/java/org/distorted/examples/inflate/InflateSurfaceView.java
+++ b/src/main/java/org/distorted/examples/inflate/InflateSurfaceView.java
@@ -19,6 +19,8 @@
 
 package org.distorted.examples.inflate;
 
+import org.distorted.examples.R;
+
 import android.app.ActivityManager;
 import android.content.Context;
 import android.content.pm.ConfigurationInfo;
@@ -27,8 +29,6 @@ import android.util.AttributeSet;
 import android.view.MotionEvent;
 import android.widget.Toast;
 
-import org.distorted.examples.R;
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 class InflateSurfaceView extends GLSurfaceView
diff --git a/src/main/res/layout/cubeslayout.xml b/src/main/res/layout/cubeslayout.xml
deleted file mode 100644
index 3d273a4..0000000
--- a/src/main/res/layout/cubeslayout.xml
+++ /dev/null
@@ -1,38 +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:gravity="center_horizontal"
-    android:orientation="vertical" >
-
-    <org.distorted.examples.cubes.CubesSurfaceView
-        android:id="@+id/cubesSurfaceView"
-        android:layout_width="match_parent"
-        android:layout_height="0dp"
-        android:layout_weight="1.00" />
-
-    <LinearLayout
-        android:id="@+id/linearLayout3"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center|fill_horizontal"
-        android:orientation="horizontal"
-        android:background="@color/blue">
-
-        <SeekBar
-            android:id="@+id/cubesTransparency"
-            android:layout_weight="0.5"
-            android:layout_width="0dp"
-            android:layout_height="50dp"
-            android:paddingLeft="10dp"
-            android:paddingRight="10dp" />
-
-        <Spinner
-            android:layout_width="0dp"
-            android:layout_height="50dp"
-            android:layout_weight="0.5"
-            android:id="@+id/cubes_spinnerMode"
-            />
-    </LinearLayout>
-
-</LinearLayout>
diff --git a/src/main/res/layout/earthlayout.xml b/src/main/res/layout/earthlayout.xml
new file mode 100644
index 0000000..1bd95f5
--- /dev/null
+++ b/src/main/res/layout/earthlayout.xml
@@ -0,0 +1,40 @@
+<?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:gravity="center_horizontal"
+    android:orientation="vertical" >
+
+    <org.distorted.examples.earth.EarthSurfaceView
+        android:id="@+id/earthSurfaceView"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1.00" />
+
+    <LinearLayout
+        android:id="@+id/linearLayout"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center|fill_horizontal"
+        android:orientation="horizontal"
+        android:background="@color/blue">
+
+        <TextView
+            android:id="@+id/earthInflateText"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="0.3"
+            android:paddingLeft="10dp"
+            android:text="@string/inflate" />
+
+        <SeekBar
+            android:id="@+id/earthInflateLevel"
+            android:layout_weight="0.7"
+            android:layout_width="0dp"
+            android:layout_height="50dp"
+            android:paddingLeft="10dp"
+            android:paddingRight="10dp" />
+
+    </LinearLayout>
+
+</LinearLayout>
diff --git a/src/main/res/layout/inflatelayout.xml b/src/main/res/layout/inflatelayout.xml
index 9fbdfeb..47613f1 100644
--- a/src/main/res/layout/inflatelayout.xml
+++ b/src/main/res/layout/inflatelayout.xml
@@ -20,7 +20,7 @@
         android:background="@color/blue">
 
         <TextView
-            android:id="@+id/inflateText"
+            android:id="@+id/inflateInflateText"
             android:layout_width="0dp"
             android:layout_height="wrap_content"
             android:layout_weight="0.3"
@@ -28,13 +28,37 @@
             android:text="@string/inflate" />
 
         <SeekBar
-            android:id="@+id/inflateLevel"
+            android:id="@+id/inflateInflateLevel"
             android:layout_weight="0.7"
             android:layout_width="0dp"
             android:layout_height="50dp"
             android:paddingLeft="10dp"
+            android:paddingRight="5dp" />
+
+    </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:background="@color/blue">
+
+        <SeekBar
+            android:id="@+id/inflateTransparency"
+            android:layout_weight="0.50"
+            android:layout_width="0dp"
+            android:layout_height="50dp"
+            android:paddingLeft="10dp"
             android:paddingRight="10dp" />
 
+        <Spinner
+            android:layout_width="0dp"
+            android:layout_height="50dp"
+            android:layout_weight="0.5"
+            android:id="@+id/inflateSpinnerMode"
+            />
     </LinearLayout>
 
 </LinearLayout>
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 27a3ee6..ecb914d 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -143,8 +143,8 @@
     <string name="example_starwars_subtitle">Shows how to create the opening crawl from Star Wars Episode IV.</string>
     <string name="example_olimpic">Olimpic Rings</string>
     <string name="example_olimpic_subtitle">Shows the Chroma effect and Node optimizations.</string>
-    <string name="example_cubes">Cubes</string>
-    <string name="example_cubes_subtitle">Tests the DistortedCubes render target.</string>
+    <string name="example_inflate">Inflate</string>
+    <string name="example_inflate_subtitle">Test inflating Meshes and rendering them with OIT mode.</string>
     <string name="example_quaternion">Quaternion</string>
     <string name="example_quaternion_subtitle">Random rotations using quaternions.</string>
     <string name="example_effects3d">Generic Test</string>
@@ -177,8 +177,8 @@
     <string name="example_glow_subtitle">Leaf glowing with light.</string>
     <string name="example_moving_glow">Glow Effect</string>
     <string name="example_moving_glow_subtitle">See moving objects glowing with light.</string>
-    <string name="example_inflate">Debug Inflating the Mesh</string>
-    <string name="example_inflate_subtitle">Just a test appliacation for the developers of the library to test the Inflate mechanism.</string>
+    <string name="example_earth">Earth</string>
+    <string name="example_earth_subtitle">Test the sphere Mesh by showing the Earth in cosmos.</string>
 
     <string name="example_movingeffects_toast">Click on \'RESET\' and define your path by touching the screen. Then click on one of the effects and see it move along your path.</string>
     <string name="example_rotate_toast">Rotate the scene by swiping the screen</string>
