Project

General

Profile

« Previous | Next » 

Revision 33647db9

Added by Leszek Koltunski about 3 years ago

Face cubit creation: compiles and runs now (but results are incorrect)

View differences:

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

  
331 331
    private void createMesh()
332 332
      {
333
      int type = 0;
334
      int numLayers = 3;
335
      float tmp   = (numLayers/3.0f)/(numLayers-1);
336
      float height= tmp*COS18;
337
      float width = tmp + type*height*SIN18/COS18;
333
      final float[][] vertices = new float[][]
334
          {
335
              { 0.5f, 0.5f, 0.5f },
336
              { 0.5f, 0.5f,-0.5f },
337
              { 0.5f,-0.5f, 0.5f },
338
              { 0.5f,-0.5f,-0.5f },
339
              {-0.5f, 0.5f, 0.5f },
340
              {-0.5f, 0.5f,-0.5f },
341
              {-0.5f,-0.5f, 0.5f },
342
              {-0.5f,-0.5f,-0.5f },
343
          };
344

  
345
      final int[][] vertIndexes = new int[][]
346
          {
347
              {0,1,3,2},
348
              {5,4,6,7},
349
              {5,1,0,4},
350
              {6,2,3,7},
351
              {4,0,2,6},
352
              {1,5,7,3}
353
          };
354

  
355
      final float[][] bands = new float[][]
356
          {
357
              {0.048f,35,0.5f,0.7f,5,  2,2}
358
          };
338 359

  
339
      FactoryCubit factory = FactoryCubit.getInstance();
340
      mMesh = factory.createKilominxEdgeMesh(numLayers, width, height, (type%2)==0 );
360
      final int[] bandIndexes = new int[] { 0,0,0,0,0,0 };
341 361

  
342
      //mMesh = createStaticMesh();
362
      FactoryCubit factory = FactoryCubit.getInstance();
363
      mMesh = factory.createRoundedSolid(vertices, vertIndexes, bands, bandIndexes);
343 364

  
344 365
      int numEff = mMesh.numEffComponents();
345 366

  

Also available in: Unified diff