Revision 6a96e571
Added by Leszek Koltunski about 3 years ago
src/main/java/org/distorted/examples/meshfile/MeshFileRenderer.java | ||
---|---|---|
252 | 252 |
|
253 | 253 |
private void createMesh() |
254 | 254 |
{ |
255 |
int mode = 2;
|
|
255 |
int mode = 0;
|
|
256 | 256 |
double[][] vertices = null; |
257 | 257 |
int[][] vertIndexes = null; |
258 | 258 |
float[][] bands = null; |
... | ... | |
288 | 288 |
|
289 | 289 |
bands = new float[][] |
290 | 290 |
{ |
291 |
{0.05f,45,0.6f,0.5f,5, 2,2}
|
|
291 |
{0.05f,40,0.5f,0.2f,5, 2,2}
|
|
292 | 292 |
}; |
293 | 293 |
|
294 | 294 |
bandIndexes = new int[] { 0,0,0,0,0,0 }; |
... | ... | |
358 | 358 |
|
359 | 359 |
bands = new float[][] |
360 | 360 |
{ |
361 |
{0.028f,30,0.166f,0.8f,7, 2,5},
|
|
362 |
{0.028f,30,0.166f,0.8f,7, 1,2}
|
|
361 |
{0.028f,30,0.25f,0.1f,7, 2,5},
|
|
362 |
{0.001f,30,0.25f,0.1f,7, 1,2}
|
|
363 | 363 |
}; |
364 | 364 |
|
365 | 365 |
bandIndexes = new int[] { 0,1,1,0 }; |
... | ... | |
372 | 372 |
cornerIndexes = new int[] { 0,0,0,0 }; |
373 | 373 |
} |
374 | 374 |
|
375 |
///// OCTAHEDRON //////////////////////////////////////////////////////////////////////////// |
|
376 |
|
|
377 |
else if( mode==3 ) |
|
378 |
{ |
|
379 |
vertices = new double[][] |
|
380 |
{ |
|
381 |
{ 0.5, 0.0, 0.5}, |
|
382 |
{ 0.5, 0.0,-0.5}, |
|
383 |
{-0.5, 0.0,-0.5}, |
|
384 |
{-0.5, 0.0, 0.5}, |
|
385 |
{ 0.0, SQ2/2, 0.0}, |
|
386 |
{ 0.0,-SQ2/2, 0.0}, |
|
387 |
}; |
|
388 |
|
|
389 |
vertIndexes = new int[][] |
|
390 |
{ |
|
391 |
{3,0,4}, // counterclockwise! |
|
392 |
{0,1,4}, |
|
393 |
{1,2,4}, |
|
394 |
{2,3,4}, |
|
395 |
{5,0,3}, |
|
396 |
{5,1,0}, |
|
397 |
{5,2,1}, |
|
398 |
{5,3,2} |
|
399 |
}; |
|
400 |
|
|
401 |
bands = new float[][] |
|
402 |
{ |
|
403 |
{0.05f,17,0.5f,0.2f,5, 2,2} |
|
404 |
}; |
|
405 |
|
|
406 |
bandIndexes = new int[] { 0,0,0,0,0,0,0,0 }; |
|
407 |
|
|
408 |
corners = new float[][] |
|
409 |
{ |
|
410 |
{ 0.03f, 0.12f } |
|
411 |
}; |
|
412 |
|
|
413 |
cornerIndexes = new int[] { 0,0,0,0,0,0 }; |
|
414 |
} |
|
415 |
|
|
375 | 416 |
FactoryCubit factory = FactoryCubit.getInstance(); |
376 | 417 |
mMesh = factory.createRoundedSolid(vertices, vertIndexes, bands, bandIndexes, corners, cornerIndexes); |
377 | 418 |
|
Also available in: Unified diff
Cubit creation: center the textures. Add octahedron.