Project

General

Profile

« Previous | Next » 

Revision d2f57a83

Added by Leszek Koltunski 11 months ago

Multigon testing app

View differences:

src/main/java/org/distorted/examples/meshfile/MeshFileRenderer.java
355 355

  
356 356
    private void createMesh()
357 357
      {
358
      float A = 2.0f;
359

  
358 360
      float[][] vertices =
359 361
          {
360 362
              { 0.5f, 0.5f, 0.5f },
......
366 368
              {-0.5f,-0.5f, 0.5f },
367 369
              {-0.5f,-0.5f,-0.5f },
368 370

  
369
              {-0.5f, 0.0f, 0.5f },
370
              { 0.5f, 0.0f, 0.5f },
371
              { 0.5f,   -A, 0.5f },
372
              { 0.5f,   -A,-0.5f },
373
              {-0.5f,   -A, 0.5f },
374
              {-0.5f,   -A,-0.5f },
375

  
376
              {   -A, 0.5f, 0.5f },
377
              {   -A, 0.5f,-0.5f },
378
              {   -A,-0.5f, 0.5f },
379
              {   -A,-0.5f,-0.5f },
371 380
          };
372 381

  
373 382
      int[][][] vertIndices =
374 383
          {
375
              { {2,3,1,0} },
376
              { {7,6,4,5} },
377
              { {4,0,1,5} },
378
              { {7,3,2,6} },
379
              { {8,9,0,4}, {6,2,9,8} },
380
              { {3,7,5,1} }
384
              { { 8, 9, 1, 0} },
385
              { {15,14,12,13} },
386
              { {11,10, 6, 7} },
387
              { {12, 0, 1,13} },
388
              { {11, 9, 8,10} },
389
              { {15, 7, 6,14} },
390
              { {14, 6, 4,12}, { 6, 2, 0, 4}, {10, 8, 2, 6} },
391
              { { 3, 7, 5, 1}, { 9,11, 7, 3}, { 7,15,13, 5} }
381 392
          };
382 393

  
383
      float height = 0.05f;
394
      float height = 0.02f;
384 395
      int num = 5;
385 396
      int extraI = 1;
386 397
      int extraV = 1;
387 398

  
388
      float[][] bands= { {height,35,0.5f,0.7f,num,extraI,extraV} };
399
      float[][] bands= { {height,25,0.3f,0.5f,num,extraI,extraV} };
389 400

  
390
      int[] bandIndices = {0,0,0,0,0,0};
401
      int[] bandIndices = {0,0,0,0,0,0,0,0};
391 402
      float[] convex = null;
392 403

  
393 404
      float[][] corners= { {0.036f,0.12f} };
394 405
      float[][] centers= { {0.0f, 0.0f, 0.0f} };
395
      int[] ind    = { 0,0,0,0,0,0,0,0,-1,-1 };
406
      int[] ind    = { 0,0,-1,-1,-1,-1,-1,-1, 0,0,0,0,0,0,0,0 };
396 407

  
397 408
      ObjectShape shape = new ObjectShape(vertices, vertIndices);
398 409
      ObjectFaceShape face = new ObjectFaceShape(bands, bandIndices, convex);

Also available in: Unified diff