Project

General

Profile

« Previous | Next » 

Revision b1dea8dd

Added by Leszek Koltunski almost 4 years ago

Progress with the Kilominx.

View differences:

src/main/java/org/distorted/objects/FactoryCubit.java
50 50
  static final float MINX_C3 = (float)(Math.sqrt(10-2*SQ5)/4);    // cos(54 deg)
51 51
  static final float MINX_C4 = (float)(Math.sqrt(0.5f-0.1f*SQ5)); // cos(half the dihedral angle)
52 52
  static final float MINX_C5 = (float)(Math.sqrt(0.5f+0.1f*SQ5)); // sin(half the dihedral angle)
53
  static final float MINX_SC = 0.5f;
53 54

  
54 55
  private static final int IVY_N = 8;
55 56

  
......
692 693
    float Y1= (float)(Math.sqrt(2+0.4f*SQ5)/4);
693 694
    float Y2= Y1 - (float)(Math.sqrt(10-2*SQ5)/8);
694 695
    float H = 0.5f*MINX_C1/MINX_C3;
695
    float X2= H*MINX_C5;
696
    float Y3= H/(2*MINX_C4);
697
    float Y4= H*(1/(2*MINX_C4) - MINX_C4);
696
    float X2= MINX_SC*H*MINX_C5;
697
    float Y3= MINX_SC*H/(2*MINX_C4);
698
    float Y4= MINX_SC*H*(1/(2*MINX_C4) - MINX_C4);
698 699

  
699 700
    float[] vertices0 = { -X1, Y2, 0, -Y1, X1, Y2, 0, Y1 };
700 701
    float[] bands0 = computeBands(0.03f,39,0.3f,0.2f,5);
......
1218 1219

  
1219 1220
  VertexEffect[] createVertexEffectsMinxCorner()
1220 1221
    {
1221
    VertexEffect[] effect = new VertexEffect[9];
1222
    VertexEffect[] effect = new VertexEffect[10];
1222 1223

  
1223 1224
    float H = 0.5f*(MINX_C1/MINX_C3);
1224 1225
    float Y1= (float)(Math.sqrt(2+0.4f*SQ5)/4);
......
1246 1247
    Static1D angle6 = new Static1D(90-A/2);
1247 1248

  
1248 1249
    effect[0] = new VertexEffectMove(move1);
1249
    effect[1] = new VertexEffectMove(move2);
1250
    effect[2] = new VertexEffectRotate(angle1, axisZ, center);
1251
    effect[3] = new VertexEffectRotate(angle2, axisZ, center);
1252
    effect[4] = new VertexEffectRotate(angle3, axisA, center);
1253
    effect[5] = new VertexEffectMove(move3);
1254
    effect[6] = new VertexEffectRotate(angle4, axisC, center);
1255
    effect[7] = new VertexEffectRotate(angle5, axisC, center);
1256
    effect[8] = new VertexEffectRotate(angle6, axisY, center);
1250
    effect[1] = new VertexEffectScale(1/MINX_SC);
1251
    effect[2] = new VertexEffectMove(move2);
1252
    effect[3] = new VertexEffectRotate(angle1, axisZ, center);
1253
    effect[4] = new VertexEffectRotate(angle2, axisZ, center);
1254
    effect[5] = new VertexEffectRotate(angle3, axisA, center);
1255
    effect[6] = new VertexEffectMove(move3);
1256
    effect[7] = new VertexEffectRotate(angle4, axisC, center);
1257
    effect[8] = new VertexEffectRotate(angle5, axisC, center);
1258
    effect[9] = new VertexEffectRotate(angle6, axisY, center);
1257 1259

  
1258 1260
    effect[0].setMeshAssociation( 7,-1);  // meshes 0,1,2
1259 1261
    effect[1].setMeshAssociation(56,-1);  // meshes 3,4,5
1260
    effect[2].setMeshAssociation( 7,-1);  // meshes 0,1,2
1261
    effect[3].setMeshAssociation(56,-1);  // meshes 3,4,5
1262
    effect[2].setMeshAssociation(56,-1);  // meshes 3,4,5
1263
    effect[3].setMeshAssociation( 7,-1);  // meshes 0,1,2
1262 1264
    effect[4].setMeshAssociation(56,-1);  // meshes 3,4,5
1263 1265
    effect[5].setMeshAssociation(56,-1);  // meshes 3,4,5
1264
    effect[6].setMeshAssociation(18,-1);  // meshes 1,4
1265
    effect[7].setMeshAssociation(36,-1);  // meshes 2,5
1266
    effect[6].setMeshAssociation(56,-1);  // meshes 3,4,5
1267
    effect[7].setMeshAssociation(18,-1);  // meshes 1,4
1268
    effect[8].setMeshAssociation(36,-1);  // meshes 2,5
1266 1269

  
1267 1270
    return effect;
1268 1271
    }
src/main/java/org/distorted/objects/TwistyMinx.java
42 42
{
43 43
  private static final int FACES_PER_CUBIT =6;
44 44

  
45
  static final float C0 = (SQ5-1)/4;
46
  static final float C1 = (SQ5+1)/4;
45
  static final float C0 = (SQ5-1)/4;                       // cos(72 deg)
46
  static final float C1 = (SQ5+1)/4;                       // cos(36 deg)
47 47
  static final float C2 = (SQ5+3)/4;
48 48
  static final float C3 = (float)(Math.sqrt(10-2*SQ5)/4);  // cos(54 deg)
49 49

  
......
271 271
      case  1: return 2;
272 272
      case  2: return 3;
273 273
      case  3: return 1;
274
      case  4: return 43;
275
      case  5: return 9;
276
      case  6: return 42;
277
      case  7: return 10;
278
      case  8: return 36;
279
      case  9: return 5;
280
      case 10: return 39;
281
      case 11: return 6;
282
      case 12: return 59;
274
      case  4: return 40;
275
      case  5: return 31;
276
      case  6: return 41;
277
      case  7: return 30;
278
      case  8: return 39;
279
      case  9: return 35;
280
      case 10: return 36;
281
      case 11: return 34;
282
      case 12: return 56;
283 283
      case 13: return 32;
284
      case 14: return 47;
284
      case 14: return 43;
285 285
      case 15: return 21;
286
      case 16: return 58;
287
      case 17: return 34;
288
      case 18: return 46;
286
      case 16: return 48;
287
      case 17: return 28;
288
      case 18: return 42;
289 289
      case 19: return 23;
290 290
      }
291 291

  

Also available in: Unified diff