Revision 376f605e
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objectlib/objects/TwistyTrajber.java | ||
---|---|---|
40 | 40 |
public class TwistyTrajber extends ShapeOctahedron |
41 | 41 |
{ |
42 | 42 |
// each cut is at 1/6 of the length of the segment from the center to a vertex. |
43 |
private static final float CUT = 1.0f/6;
|
|
43 |
private static final float CUT = 0.2f;
|
|
44 | 44 |
private static final float LEN = 1.5f; |
45 | 45 |
|
46 | 46 |
// the three rotation axis of a 3x3x3 cube. Must be normalized. |
... | ... | |
325 | 325 |
{9,10,12,11} |
326 | 326 |
}; |
327 | 327 |
|
328 |
float[][] bands = new float[][] { {0.00f,35,0.15f,0.3f,4,1,1},{0.00f,35,0.15f,0.3f,4,0,0} };
|
|
328 |
float[][] bands = new float[][] { {0.05f,35,0.15f,0.3f,4,1,1},{0.00f,35,0.15f,0.3f,4,0,0} };
|
|
329 | 329 |
int[] bandIndices = new int[] { 0,0,0,0,1,1,1,1,1 }; |
330 | 330 |
float[][] corners = new float[][] { {0.03f,0.10f} }; |
331 | 331 |
int[] cornerIndices = new int[] { 0,-1,-1,-1,-1,0,0,0,0,-1,-1,-1,-1 }; |
... | ... | |
336 | 336 |
if( variant==1 ) |
337 | 337 |
{ |
338 | 338 |
final float A = SQ2*CUT*LEN; |
339 |
final float B = CUT*LEN;
|
|
340 |
final float C = LEN-2*LEN*CUT;
|
|
339 |
final float B = LEN-2*LEN*CUT;
|
|
340 |
final float C = (SQ2/2)*A;
|
|
341 | 341 |
|
342 | 342 |
float[][] vertices = new float[][] |
343 | 343 |
{ |
344 |
{ -C, 0, 0},
|
|
345 |
{ -C+A, A, -B},
|
|
346 |
{ -C+A, -A, -B},
|
|
347 |
{ C, 0, 0},
|
|
348 |
{ C-A, A, -B},
|
|
349 |
{ C-A, -A, -B},
|
|
350 |
{ 0, A, -C},
|
|
351 |
{ 0, -A, -C},
|
|
344 |
{ -B, 0, 0 },
|
|
345 |
{ -B+C, A, -C },
|
|
346 |
{ -B+C,-A, -C },
|
|
347 |
{ B, 0, 0 },
|
|
348 |
{ B-C, A, -C },
|
|
349 |
{ B-C,-A, -C },
|
|
350 |
{ 0, A, -B },
|
|
351 |
{ 0,-A, -B },
|
|
352 | 352 |
}; |
353 | 353 |
|
354 | 354 |
int[][] vert_indices = new int[][] |
... | ... | |
361 | 361 |
{3,5,7,6,4} |
362 | 362 |
}; |
363 | 363 |
|
364 |
float[][] bands = new float[][] { {0.00f,35,0.15f,0.3f,3,1,1},{0.00f,35,0.15f,0.3f,3,0,0} };
|
|
364 |
float[][] bands = new float[][] { {0.03f,35,0.15f,0.3f,3,1,1},{0.00f,35,0.15f,0.3f,3,0,0} };
|
|
365 | 365 |
int[] bandIndices = new int[] { 0,0,1,1,1,1 }; |
366 | 366 |
float[][] corners = new float[][] { {0.02f,0.10f} }; |
367 | 367 |
int[] cornerIndices = new int[] { 0,0,0,0,0,0,-1,-1 }; |
368 |
float[][] centers = new float[][] { { 0, 0, -LEN/2} };
|
|
368 |
float[][] centers = new float[][] { { 0, 0, -B} };
|
|
369 | 369 |
int[] centerIndices = new int[] { 0,0,0,0,0,0,-1,-1 }; |
370 | 370 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
371 | 371 |
} |
372 | 372 |
else |
373 | 373 |
{ |
374 |
final float A = SQ2*CUT*LEN; |
|
375 |
final float C = LEN-2*LEN*CUT; |
|
376 |
final float L = C-A; |
|
374 |
final float L = LEN-3*LEN*CUT; |
|
377 | 375 |
|
378 | 376 |
float[][] vertices = new float[][] |
379 | 377 |
{ |
... | ... | |
391 | 389 |
{1,3,2}, |
392 | 390 |
}; |
393 | 391 |
|
394 |
float[][] bands = new float[][] { {0.00f,35,0.15f,0.3f,4,1,1},{0.00f,35,0.15f,0.3f,4,0,0} };
|
|
392 |
float[][] bands = new float[][] { {0.03f,35,0.15f,0.3f,4,1,1},{0.00f,35,0.15f,0.3f,4,0,0} };
|
|
395 | 393 |
int[] bandIndices = new int[] { 0,1,1,1 }; |
396 | 394 |
float[][] corners = new float[][] { {0.02f,0.10f} }; |
397 | 395 |
int[] cornerIndices = new int[] { 0,0,0,-1 }; |
... | ... | |
470 | 468 |
float[][] STICKERS = new float[][] |
471 | 469 |
{ |
472 | 470 |
{ -0.5f, -0.2886751f, 0.16666666f, -0.2886751f, 0.5f, 0.2886751f, -0.16666666f, 0.2886751f }, |
473 |
{ -0.5f, -0.10825317f, 0.5f, -0.10825317f, 0.3232233f, 0.10825317f, -0.32322332f, 0.10825317f },
|
|
471 |
{ -0.5f, -0.14433758f, 0.49999997f, -0.14433758f, 0.33333334f, 0.14433758f, -0.33333334f, 0.14433758f },
|
|
474 | 472 |
{ -0.43301275f, -0.25f, 0.4330127f, -0.25f, 0.0f, 0.5f } |
475 | 473 |
}; |
476 | 474 |
|
477 | 475 |
float R1 = 0.09f; |
478 |
float R2 = 0.03f;
|
|
479 |
float R3 = 0.04f;
|
|
480 |
float[] strokes = new float[] { 0.10f,0.03f,0.04f };
|
|
476 |
float R2 = 0.05f;
|
|
477 |
float R3 = 0.06f;
|
|
478 |
float[] strokes = new float[] { 0.10f,0.05f,0.06f };
|
|
481 | 479 |
float[][] radii = new float[][] { {R1,R1,R1,R1},{R2,R2,R2,R2},{R3,R3,R3} }; |
482 | 480 |
|
483 | 481 |
if( ObjectControl.isInIconMode() ) |
Also available in: Unified diff
Trajber's Octahedron: progress.