Project

General

Profile

« Previous | Next » 

Revision 31d42722

Added by Leszek Koltunski over 3 years ago

Add Square-2 corner cubit.

View differences:

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

  
254 254
    private void createMesh()
255 255
      {
256
      int mode = 10;
256
      int mode = 12;
257 257
      int numComponents = 0;
258 258
      double[][] vertices = null;
259 259
      int[][] vertIndexes = null;
......
960 960
        numComponents = 6;
961 961
        }
962 962

  
963
      ///// SQUARE-2 CORNER ///////////////////////////////////////////////////////////////
964

  
965
      else if( mode==12 )
966
        {
967
        final float X = 3*(2-SQ3)/2;
968
        final float Z = 0.75f - X/2;
969

  
970
        vertices = new double[][]
971
          {
972
              { X-1.5+Z, 0.5,  0.0 },
973
              {       Z, 0.5,  0.0 },
974
              {  -1.5+Z, 0.5, -1.5 },
975
              { X-1.5+Z,-0.5,  0.0 },
976
              {       Z,-0.5,  0.0 },
977
              {  -1.5+Z,-0.5, -1.5 }
978
          };
979

  
980
        vertIndexes = new int[][]
981
          {
982
              {0,1,2},   // counterclockwise!
983
              {5,4,3},
984
              {3,4,1,0},
985
              {4,5,2,1},
986
              {5,3,0,2}
987
          };
988

  
989
        bands = new float[][]
990
          {
991
            {0.040f,35,0.9f,1.0f, 5,2,1},
992
            {0.001f,35,0.9f,1.0f, 5,2,1}
993
          };
994

  
995
        bandIndexes = new int[] { 0,0,0,1,1 };
996

  
997
        corners = new float[][]
998
          {
999
            {0.05f,0.13f}
1000
          };
1001

  
1002
        cornerIndexes = new int[] { 0,0,-1,0,0,-1 };
1003

  
1004
        centers = new float[][]
1005
          {
1006
             { 0.0f, 0.0f,-0.5f}
1007
          };
1008

  
1009
        centerIndexes = new int[] { 0,0,-1,0,0,-1 };
1010

  
1011
        numComponents = 5;
1012
        }
1013

  
963 1014
      ///// END DEFINITIONS /////////////////////////////////////////////////////////////////
964 1015

  
965 1016
      FactoryCubit factory = FactoryCubit.getInstance();

Also available in: Unified diff