commit ed01e351c0d98152a9ef0e0011140f17cd0b7d45
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Wed Jan 27 16:42:16 2021 +0100

    Progress with Megaminx.

diff --git a/src/main/java/org/distorted/objects/FactoryCubit.java b/src/main/java/org/distorted/objects/FactoryCubit.java
index 1c92c642..91838a89 100644
--- a/src/main/java/org/distorted/objects/FactoryCubit.java
+++ b/src/main/java/org/distorted/objects/FactoryCubit.java
@@ -773,7 +773,7 @@ class FactoryCubit
     float[] vertices1 = { -X1, Y3, -X1, -Y3, X1, -Y2, X1, Y2 };
     float[] vertices2 = { -X2, 0.0f, 0.0f, -Y4, X2, 0.0f, 0.0f, Y4 };
 
-    float[] bands0 = computeBands(0.04f,34,  X1,0.2f,5);
+    float[] bands0 = computeBands(0.03f,34,0.2f,0.2f,5);
     float[] bands1 = computeBands(0.00f,34,0.3f,0.2f,2);
 
     meshes[0] = new MeshPolygon(vertices0, bands0, 0, 0);
@@ -798,9 +798,8 @@ class FactoryCubit
     {
     MeshBase[] meshes = new MeshPolygon[2];
 
-    float R  = width/(2*COS54);
-
-    float X1 = width/2;
+    float R  = 0.5f;
+    float X1 = R*COS54;
     float Y1 = R*SIN54;
     float X2 = R*COS18;
     float Y2 = R*SIN18;
@@ -1478,15 +1477,16 @@ class FactoryCubit
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  VertexEffect[] createVertexEffectsMegaminxCenter()
+  VertexEffect[] createVertexEffectsMegaminxCenter(float width)
     {
-    VertexEffect[] effect = new VertexEffect[1];
+    VertexEffect[] effect = new VertexEffect[2];
 
     Static1D angle = new Static1D(DIHEDRAL2);
     Static3D axisX = new Static3D( 1.0f, 0.0f, 0.0f);
     Static3D center= new Static3D( 0, 0, 0);
 
-    effect[0] = new VertexEffectRotate(angle, axisX, center);
+    effect[0] = new VertexEffectScale(width/COS54);
+    effect[1] = new VertexEffectRotate(angle, axisX, center);
 
     return effect;
     }
@@ -1923,7 +1923,7 @@ class FactoryCubit
   MeshBase createMegaminxCenterMesh(float width)
     {
     MeshBase mesh = createFacesMegaminxCenter(width);
-    VertexEffect[] effects = createVertexEffectsMegaminxCenter();
+    VertexEffect[] effects = createVertexEffectsMegaminxCenter(width);
     for( VertexEffect effect : effects ) mesh.apply(effect);
 
     mesh.mergeEffComponents();
diff --git a/src/main/java/org/distorted/objects/TwistyMegaminx.java b/src/main/java/org/distorted/objects/TwistyMegaminx.java
index 1c9565e1..a532243b 100644
--- a/src/main/java/org/distorted/objects/TwistyMegaminx.java
+++ b/src/main/java/org/distorted/objects/TwistyMegaminx.java
@@ -544,14 +544,14 @@ public class TwistyMegaminx extends TwistyMinx
         }
       else
         {
-        float Z = width/(2*COS54);
-        float X1 = 0.5f*width;
+        float Z  = 0.5f;
+        float X1 = Z*COS54;
         float Y1 = Z*SIN54;
         float X2 = Z*COS18;
         float Y2 = Z*SIN18;
 
-        R = 0.05f;
-        S = 0.05f;
+        R = 0.10f;
+        S = 0.06f;
         vertices = new float[] { -X1,+Y1, -X2,-Y2, 0.0f,-Z, +X2,-Y2, +X1,+Y1 };
         }
       }
