commit 251e574e1866ed651d979b081d0d25c5942a83e1
Author: Leszek Koltunski <leszek@distoretedandroid.org>
Date:   Mon Dec 12 17:37:04 2016 +0000

    Some fixes for the recent API change

diff --git a/src/main/java/org/distorted/examples/quaternion/QuaternionRenderer.java b/src/main/java/org/distorted/examples/quaternion/QuaternionRenderer.java
index 281c6b1..ab8b2ca 100644
--- a/src/main/java/org/distorted/examples/quaternion/QuaternionRenderer.java
+++ b/src/main/java/org/distorted/examples/quaternion/QuaternionRenderer.java
@@ -47,8 +47,7 @@ import android.opengl.GLSurfaceView;
 class QuaternionRenderer implements GLSurfaceView.Renderer 
   {
   private static final int NUM_QUATERNIONS = 5;
-  private static final int SIZE = 100;
-	
+
   private GLSurfaceView mView;
   private DistortedObject mCube;
   private DistortedCubesGrid mGrid;
@@ -60,7 +59,7 @@ class QuaternionRenderer implements GLSurfaceView.Renderer
   QuaternionRenderer(GLSurfaceView v)
     {
     mView = v;
-    mGrid = new DistortedCubesGrid( 3, "000010000", false);
+    mGrid = new DistortedCubesGrid(1,1,false);
     mCube = new DistortedObject(1,1,1);
 
     mRot = new DynamicQuat();
@@ -97,20 +96,12 @@ class QuaternionRenderer implements GLSurfaceView.Renderer
     
   public void onSurfaceChanged(GL10 glUnused, int width, int height) 
     {
-    mCube.abortEffects(EffectTypes.MATRIX);
+    float scaleFactor = width>height ? height/3:width/3;
 
-    if( width > height )
-      {
-      mCube.move( new Static3D((width-height)/2,0,0) );
-      mCube.scale(height/(3.0f*SIZE));
-      }  
-    else
-      {
-      mCube.move( new Static3D(0,(height-width)/2,0) );
-      mCube.scale(width/(3.0f*SIZE));
-      }
-     
-    mCube.quaternion( mRot, new Static3D(3*SIZE/2,3*SIZE/2,0) );
+    mCube.abortEffects(EffectTypes.MATRIX);
+    mCube.move( new Static3D( (width-scaleFactor)/2 , (height-scaleFactor)/2 , 0) );
+    mCube.scale(scaleFactor);
+    mCube.quaternion( mRot, new Static3D(0.5f,0.5f,0) );
        
     Distorted.onSurfaceChanged(width, height); 
     }
