Revision 4b2cad6d
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/examples/meshfile/MeshFileRenderer.java | ||
---|---|---|
253 | 253 |
|
254 | 254 |
private void createMesh() |
255 | 255 |
{ |
256 |
int mode = 12;
|
|
256 |
int mode = 13;
|
|
257 | 257 |
int numComponents = 0; |
258 | 258 |
double[][] vertices = null; |
259 | 259 |
int[][] vertIndexes = null; |
... | ... | |
364 | 364 |
{ |
365 | 365 |
vertices = new double[][] |
366 | 366 |
{ |
367 |
{-0.5, 0.0, 0.0},
|
|
368 |
{ 0.5, 0.0, 0.0},
|
|
369 |
{ 0.0,-0.5, 0.0},
|
|
370 |
{ 0.0, 0.0,-0.5}
|
|
367 |
{-1.5, 0.0, 0.0},
|
|
368 |
{ 1.5, 0.0, 0.0},
|
|
369 |
{ 0.0,-1.5, 0.0},
|
|
370 |
{ 0.0, 0.0,-1.5}
|
|
371 | 371 |
}; |
372 | 372 |
|
373 | 373 |
vertIndexes = new int[][] |
374 | 374 |
{ |
375 |
{2,1,0}, // counterclockwise!
|
|
376 |
{2,3,1},
|
|
377 |
{3,2,0},
|
|
378 |
{3,0,1}
|
|
375 |
{2,1,0}, // counterclockwise! |
|
376 |
{3,0,1},
|
|
377 |
{2,3,1},
|
|
378 |
{3,2,0},
|
|
379 | 379 |
}; |
380 | 380 |
|
381 | 381 |
bands = new float[][] |
382 | 382 |
{ |
383 |
{0.028f,30,0.25f,0.1f,7, 2,5},
|
|
384 |
{0.001f,30,0.25f,0.1f,7, 1,2}
|
|
383 |
{0.035f,30,0.16f,0.8f,6,2,2},
|
|
384 |
{0.010f,45,0.16f,0.2f,6,2,2}
|
|
385 | 385 |
}; |
386 | 386 |
|
387 |
bandIndexes = new int[] { 0,1,1,0 };
|
|
387 |
bandIndexes = new int[] { 0,0,1,1 };
|
|
388 | 388 |
|
389 | 389 |
corners = new float[][] |
390 | 390 |
{ |
391 |
{ 0.02f, 0.04f } |
|
391 |
{0.07f,0.40f}, |
|
392 |
{0.05f,0.30f} |
|
392 | 393 |
}; |
393 | 394 |
|
394 |
cornerIndexes = new int[] { 0,0,0,0 };
|
|
395 |
cornerIndexes = new int[] { 0,0,1,1 };
|
|
395 | 396 |
|
396 | 397 |
centers = new float[][] |
397 | 398 |
{ |
398 |
{ 0.0f,-0.25f,-0.25f }
|
|
399 |
{ 0.0f,-0.75f,-0.75f }
|
|
399 | 400 |
}; |
400 | 401 |
|
401 | 402 |
centerIndexes = new int[] { 0,0,0,0 }; |
... | ... | |
1011 | 1012 |
numComponents = 5; |
1012 | 1013 |
} |
1013 | 1014 |
|
1015 |
///// REDI CORNER /////////////////////////////////////////////////////////////// |
|
1016 |
|
|
1017 |
else if( mode==13 ) |
|
1018 |
{ |
|
1019 |
vertices = new double[][] |
|
1020 |
{ |
|
1021 |
{ 0.0f, 0.0f, 0.0f }, |
|
1022 |
{-0.5f, 0.5f, 0.5f }, |
|
1023 |
{-0.5f,-0.5f, 0.5f }, |
|
1024 |
{ 0.5f, 0.5f, 0.5f }, |
|
1025 |
{ 0.5f,-0.5f, 0.5f }, |
|
1026 |
{ 0.5f, 0.5f,-0.5f }, |
|
1027 |
{ 0.5f,-0.5f,-0.5f }, |
|
1028 |
{-0.5f, 0.5f,-0.5f }, |
|
1029 |
}; |
|
1030 |
|
|
1031 |
vertIndexes = new int[][] |
|
1032 |
{ |
|
1033 |
{ 2,4,3,1 }, |
|
1034 |
{ 1,3,5,7 }, |
|
1035 |
{ 4,6,5,3 }, |
|
1036 |
|
|
1037 |
{ 2,4,0 }, |
|
1038 |
{ 5,7,0 }, |
|
1039 |
{ 4,6,0 }, |
|
1040 |
{ 7,1,0 }, |
|
1041 |
{ 1,2,0 }, |
|
1042 |
{ 6,5,0 } |
|
1043 |
}; |
|
1044 |
|
|
1045 |
bands = new float[][] |
|
1046 |
{ |
|
1047 |
{0.06f,35,0.5f,0.7f,5,2,2}, |
|
1048 |
{0.01f,35,0.2f,0.4f,5,2,2} |
|
1049 |
}; |
|
1050 |
|
|
1051 |
bandIndexes = new int[] { 0,0,0,1,1,1,1,1,1 }; |
|
1052 |
|
|
1053 |
corners = new float[][] |
|
1054 |
{ |
|
1055 |
{0.06f,0.12f} |
|
1056 |
}; |
|
1057 |
|
|
1058 |
cornerIndexes = new int[] { -1,0,-1,0,0,0,-1,-1 }; |
|
1059 |
|
|
1060 |
centers = new float[][] |
|
1061 |
{ |
|
1062 |
{ 0.0f, 0.0f, 0.0f} |
|
1063 |
}; |
|
1064 |
|
|
1065 |
centerIndexes = new int[] { -1,0,-1,0,0,0,-1,-1 }; |
|
1066 |
|
|
1067 |
numComponents = 9; |
|
1068 |
} |
|
1069 |
|
|
1014 | 1070 |
///// END DEFINITIONS ///////////////////////////////////////////////////////////////// |
1015 | 1071 |
|
1016 | 1072 |
FactoryCubit factory = FactoryCubit.getInstance(); |
Also available in: Unified diff
Correct the Redmi mesh to eliminate the visible seams.