Project

General

Profile

« Previous | Next » 

Revision a76d9cb4

Added by Leszek Koltunski over 2 years ago

Correct the cuts of Mega/Kilominx.

View differences:

src/main/java/org/distorted/objects/TwistyMinx.java
514 514
      {
515 515
      mCuts = new float[6][numLayers-1];
516 516
      float D = numLayers*MovementMinx.DIST3D;
517
      float E = 2*SIN54;
518
      float X = 2*D*E/(1+2*E);  // height of the 'upper' part of a dodecahedron, i.e. put it on a table,
519
                                // its height is then D*2*DIST3D, it has one 'lower' part of height X, one
517
      float X = 2*D/(2+SIN18);  // height of the 'upper' part of a dodecahedron, i.e. put it on a table,
518
                                // its height is then 2D, it has one 'lower' part of height X, one
520 519
                                // 'middle' part of height Y and one upper part of height X again.
521
                                // It's edge length = numLayers/3.0f.
522 520
      int num = (numLayers-1)/2;
523 521
      float G = X*dist/num;     // height of one Layer
524 522

  
525 523
      for(int i=0; i<num; i++)
526 524
        {
527
        float cut = -D + (i+0.5f)*G;
525
        float cut = -D + (i+0.85f)*G;  // 0.85? not fully correct; attempt to make it
526
                                       // easier to rotate the outer layers
528 527
        int j = 2*num-1-i;
529 528
        mCuts[0][i] = +cut;
530 529
        mCuts[0][j] = -cut;

Also available in: Unified diff