Project

General

Profile

« Previous | Next » 

Revision 66de0d91

Added by Leszek Koltunski over 2 years ago

Make the Master Kilominx' and Gigaminx' meshes much smaller.

View differences:

src/main/java/org/distorted/objectlib/objects/TwistyKilominx.java
315 315
    int[] numLayers = getNumLayers();
316 316
    int numVariants = getNumCubitVariants(numLayers);
317 317
    int numL        = numLayers[0];
318
    boolean small   = numL<=3;
318 319

  
319
    if( variant==0 && numL>3 )
320
    if( variant==0 && !small )
320 321
      {
321 322
      float width = numL/(numL-1.0f);
322 323
      float A = (2*SQ3/3)*SIN54;
......
349 350

  
350 351
      float[][] bands     = new float[][]
351 352
        {
352
         {0.04f,34,0.3f,0.2f, 3, 1, 0},
353
         {0.00f, 0,0.0f,0.0f, 2, 1, 0}
353
         {0.04f,34,0.3f,0.2f, 3, 0, 0},
354
         {0.00f,34,0.0f,0.0f, 2, 0, 0}
354 355
        };
355 356

  
356 357
      int[] bandIndices   = new int[] { 0,0,0,1,1,1};
......
412 413
          }
413 414
        }
414 415

  
415
      int numBands0 = numL<=5 ? 4 : 3;
416
      int numBands1 = numL<=5 ? 3 : 2;
416
      int E  = small ? 1 : 0;
417
      int N0 = small ? 4 : 3;
418
      int N1 = small ? 3 : 2;
417 419

  
418 420
      float[][] bands = new float[][]
419 421
        {
420
         {0.04f,34,0.2f,0.2f,numBands0,1,1},
421
         {0.00f, 0,0.0f,0.0f,numBands1,0,0}
422
         {0.04f,34,0.2f,0.2f,N0,E,E},
423
         {0.00f,34,0.0f,0.0f,N1,0,0}
422 424
        };
423 425

  
424 426
      int[] bandIndices   = new int[] { 0,0,1,1,1,1};
......
441 443
      double X3= H*SIN_HALFD;
442 444
      double Z3= H*COS_HALFD;
443 445
      double C = 1/(COS54*Math.sqrt(2-2*SIN18));
444
      int N = numL==3 ? 4 : 3;
445
      int E = numL==3 ? 1 : 0;
446
      int N = small ? 4 : 3;
447
      int E = small ? 1 : 0;
446 448

  
447 449
      double[][] vertices = new double[][]
448 450
        {
......
468 470

  
469 471
      float[][] bands = new float[][]
470 472
        {
471
         {0.04f,17,0.3f,0.2f,N,1,E},
472
         {0.00f,17,0.3f,0.2f,N,1,E}
473
         {0.04f,17,0.3f,0.2f,N,E,E},
474
         {0.00f,17,0.3f,0.2f,N,E,E}
473 475
        };
474 476

  
475 477
      float A = (2*SQ3/3)*SIN54;
src/main/java/org/distorted/objectlib/objects/TwistyMegaminx.java
257 257
    int[] numLayers = getNumLayers();
258 258
    int numVariants = getNumCubitVariants(numLayers);
259 259
    int numL        = numLayers[0];
260
    boolean small   = numL<=3;
260 261

  
261 262
    if( variant==0 )
262 263
      {
......
266 267
      double X = width*COS18*SIN_HALFD;
267 268
      double Y = width*SIN18;
268 269
      double Z = width*COS18*COS_HALFD;
269
      int N = numL==3 ? 1:0;
270 270

  
271 271
      double[][] vertices = new double[][]
272 272
        {
......
292 292

  
293 293
      float[][] bands    = new float[][]
294 294
        {
295
         {0.04f,34,0.3f,0.2f, 3, N, 0},
296
         {0.00f, 0,0.0f,0.0f, 2, N, 0}
295
         {0.04f,34,0.3f,0.2f, 3, 0, 0},
296
         {0.00f, 0,0.0f,0.0f, 2, 0, 0}
297 297
        };
298 298

  
299 299
      int[] bandIndices   = new int[] { 0,0,0,1,1,1};
......
337 337
            {4,5,6,7}
338 338
        };
339 339

  
340
      int N = numL<=5 ? 5 : 3;
340
      int N = small ? 5 : 3;
341 341

  
342 342
      float[][] bands = new float[][]
343 343
        {
344 344
         {0.04f,34,0.2f,0.2f,N,0,0},
345
         {0.00f, 0,0.3f,0.2f,2,0,0}
345
         {0.00f,34,0.3f,0.2f,2,0,0}
346 346
        };
347 347
      int[] bandIndices   = new int[] { 0,0,1,1,1,1};
348 348
      float[][] corners   = new float[][] { {0.04f,0.10f} };
......
381 381
          {0,1,2,3,4}
382 382
        };
383 383

  
384
      int N = numL==3 ? 4 : 3;
384
      int N = small ? 4 : 3;
385 385

  
386 386
      float[][] bands = new float[][]
387 387
        {
388 388
         {0.04f,45, R/3,0.2f,N,0,0},
389
         {0.00f, 0, R/3,0.2f,2,0,0}
389
         {0.00f,45, R/3,0.2f,2,0,0}
390 390
        };
391 391

  
392 392
      int[] bandIndices   = new int[] { 0,1 };

Also available in: Unified diff