commit 2394e617a868e048f0dc7884b687381496cf5950
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Wed Sep 9 13:27:22 2020 +0100

    Convert RubikDino to the new Polygon mesh.

diff --git a/src/main/java/org/distorted/objects/RubikDino.java b/src/main/java/org/distorted/objects/RubikDino.java
index c90448cc..d7a5421b 100644
--- a/src/main/java/org/distorted/objects/RubikDino.java
+++ b/src/main/java/org/distorted/objects/RubikDino.java
@@ -31,13 +31,12 @@ import org.distorted.library.effect.VertexEffectDeform;
 import org.distorted.library.effect.VertexEffectMove;
 import org.distorted.library.effect.VertexEffectRotate;
 import org.distorted.library.effect.VertexEffectScale;
-import org.distorted.library.effect.VertexEffectSink;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshBase;
 import org.distorted.library.mesh.MeshJoined;
+import org.distorted.library.mesh.MeshPolygon;
 import org.distorted.library.mesh.MeshSquare;
-import org.distorted.library.mesh.MeshTriangle;
 import org.distorted.library.type.Static1D;
 import org.distorted.library.type.Static3D;
 import org.distorted.library.type.Static4D;
@@ -136,9 +135,22 @@ public class RubikDino extends RubikObject
     final int MESHES=4;
 
     int association = 1;
-    MeshBase[] meshes = new MeshTriangle[MESHES];
 
-    meshes[0] = new MeshTriangle(11);
+    float D = 0.005f;
+    float E = 0.5f - D*SQ2;
+    float F = 0.5f - D*SQ2*SQ3;
+    float G = 0.005f;
+    float[] bands = { 1.0f    ,-G,
+                      1.0f-G/2,-G*0.55f,
+                      1.0f-G  ,-G*0.25f,
+                      1.0f-2*G,+G*0.25f,
+                      0.50f, 0.040f,
+                      0.0f, 0.045f };
+
+    float[] vertices = { -F,-E, +F,-E, 0.0f,E-D*SQ2};
+
+    MeshBase[] meshes = new MeshPolygon[MESHES];
+    meshes[0] = new MeshPolygon(vertices, bands, 2, 3);
     meshes[0].setEffectAssociation(0,association,0);
 
     for(int i=1; i<MESHES; i++)
@@ -181,9 +193,6 @@ public class RubikDino extends RubikObject
     Static3D center1= new Static3D(0,-SQ3*SQ2/12,-SQ3/6);
     Static3D center2= new Static3D(0,-SQ3*SQ2/12,+SQ3/3);
 
-    Static3D center = new Static3D(0,0,0);
-    Static4D region = new Static4D(0,0,0,0.6f);
-
     VertexEffectScale   effect1 = new VertexEffectScale ( new Static3D(1,SQ3/2,1) );
     VertexEffectRotate  effect2 = new VertexEffectRotate( new Static1D(90), new Static3D(1,0,0), new Static3D(0,0,0) );
     VertexEffectMove    effect3 = new VertexEffectMove  ( new Static3D(0,-SQ3*SQ2/12,SQ3/12) );
@@ -197,8 +206,6 @@ public class RubikDino extends RubikObject
     VertexEffectDeform  effect10= new VertexEffectDeform(dVec2, dRad, dCen2, dReg);
     VertexEffectDeform  effect11= new VertexEffectDeform(dVec3, dRad, dCen3, dReg);
 
-    VertexEffectSink effect12= new VertexEffectSink( new Static1D(1.25f), center, region );
-
     effect4.setMeshAssociation(14,-1);  // apply to mesh[1], [2] and [3]
     effect5.setMeshAssociation( 2,-1);  // apply only to mesh[1]
     effect6.setMeshAssociation( 4,-1);  // apply only to mesh[2]
@@ -215,7 +222,6 @@ public class RubikDino extends RubikObject
     result.apply(effect9);
     result.apply(effect10);
     result.apply(effect11);
-    result.apply(effect12);
 
     result.mergeEffComponents();
 
@@ -306,7 +312,7 @@ public class RubikDino extends RubikObject
 
   void createFaceTexture(Canvas canvas, Paint paint, int face, int left, int top, int side)
     {
-    float STROKE = 0.06f*side;
+    float STROKE = 0.044f*side;
     float OFF = STROKE/2 -1;
     float OFF2 = 0.5f*side + OFF;
     float HEIGHT = side - OFF;
