Project

General

Profile

« Previous | Next » 

Revision 12313693

Added by Leszek Koltunski over 3 years ago

Progress with the Kilominx movement (still not working)

View differences:

src/main/java/org/distorted/objects/FactoryCubit.java
45 45
  private static final float SQ5 = (float)Math.sqrt(5);
46 46
  private static final float SQ6 = (float)Math.sqrt(6);
47 47

  
48
  static final float SIN54   = (SQ5+1)/4;                         // sin(54 deg)
49
  static final float COS54   = (float)(Math.sqrt(10-2*SQ5)/4);    // cos(54 deg)
50

  
48 51
  static final float MINX_C0 = (SQ5-1)/4;
49
  static final float MINX_C1 = (SQ5+1)/4;                         // sin(54 deg)
50
  static final float MINX_C3 = (float)(Math.sqrt(10-2*SQ5)/4);    // cos(54 deg)
51 52
  static final float MINX_C4 = (float)(Math.sqrt(0.5f-0.1f*SQ5)); // cos(half the dihedral angle)
52 53
  static final float MINX_C5 = (float)(Math.sqrt(0.5f+0.1f*SQ5)); // sin(half the dihedral angle)
53 54
  static final float MINX_SC = 0.5f;
......
692 693
    float X1= (SQ5+1)/8;
693 694
    float Y1= (float)(Math.sqrt(2+0.4f*SQ5)/4);
694 695
    float Y2= Y1 - (float)(Math.sqrt(10-2*SQ5)/8);
695
    float H = 0.5f*MINX_C1/MINX_C3;
696
    float H = 0.5f* SIN54 /COS54  ;
696 697
    float X2= MINX_SC*H*MINX_C5;
697 698
    float Y3= MINX_SC*H/(2*MINX_C4);
698 699
    float Y4= MINX_SC*H*(1/(2*MINX_C4) - MINX_C4);
......
1221 1222
    {
1222 1223
    VertexEffect[] effect = new VertexEffect[10];
1223 1224

  
1224
    float H = 0.5f*(MINX_C1/MINX_C3);
1225
    float H = 0.5f*(SIN54 /COS54  );
1225 1226
    float Y1= (float)(Math.sqrt(2+0.4f*SQ5)/4);
1226 1227
    float Y2= H/(2*MINX_C4);
1227 1228
    float A = (float)(Math.acos(-SQ5/5)*180/Math.PI);  // dihedral angle of a dedecahedron in degrees
......
1631 1632
    VertexEffect[] effects = createVertexEffectsMinxCorner();
1632 1633
    for( VertexEffect effect : effects ) mesh.apply(effect);
1633 1634

  
1634
    float A = (2*SQ3/3)*MINX_C1;
1635
    float A = (2*SQ3/3)* SIN54;
1635 1636
    float B = 0.4f;
1636
    float X = MINX_C5*MINX_C1*MINX_C3;
1637
    float Y = MINX_C1*MINX_C1 - 0.5f;
1638
    float Z = MINX_C4*MINX_C1*MINX_C3;
1637
    float X = MINX_C5* SIN54 *COS54  ;
1638
    float Y = SIN54 * SIN54 - 0.5f;
1639
    float Z = MINX_C4* SIN54 *COS54  ;
1639 1640

  
1640 1641
    Static3D center = new Static3D(0.0f, -(float)Math.sqrt(1-A*A)*B,-A*B);
1641 1642

  

Also available in: Unified diff