示例#1
0
 // container = cube, 8 vertices, 6 faces of 4 vertices each
 void buildContainer()
 {
     float[][] tmpv = new float[][] {
         new float[] { S, S, S },
         new float[] { -S, S, S },
         new float[] { -S, S, -S },
         new float[] { S, S, -S },
         new float[] { S, -S, S },
         new float[] { -S, -S, S },
         new float[] { -S, -S, -S },
         new float[] { S, -S, -S }
     };
     containerVertices = tmpv;
     //  vertices need to be in a consistent order (clockwise, or counterclockwise around the face)
     int[][] tmpf = new int[][] {
         new int[] { 0, 1, 2, 3 },
         new int[] { 1, 0, 4, 5 },
         new int[] { 0, 3, 7, 4 },
         new int[] { 2, 1, 5, 6 },
         new int[] { 5, 4, 7, 6 },
         new int[] { 3, 2, 6, 7 }
     };
     containerFaces = tmpf;
     container      = new HE_Mesh();
     container.buildMesh(containerVertices, containerFaces);
     //container.roundEdges(100);
     //container.roundCorners(40);
 }
示例#2
0
 void updateContainerMesh()
 {
     container.buildMesh(containerVertices, containerFaces);
     container.roundEdges(roundEdges);
     container.roundCorners(roundCorners);
     drawMesh();
 }
示例#3
0
 // container = cube, 8 vertices, 6 faces of 4 vertices each
 void buildContainer()
 {
     containerVertices = new float[][] {
         new float[] { S, 0, S },
         new float[] { -S, 0, S },
         new float[] { -S, 0, -S },
         new float[] { S, 0, -S }
     };
     //  vertices need to be in a consistent order (clockwise, or counterclockwise around the face)
     containerFaces = new int[][] {
         new int[] { 0, 1, 2, 3 }
     };
     container = new HE_Mesh();
     container.buildMesh(containerVertices, containerFaces);
 }
示例#4
0
    void buildContainer()
    {
        float phi = 0.5f * (sqrt(5f) + 1f) * S;

        float[][] tmpv = new float[][] {
            new float[] { S, phi, 0 },
            new float[] { S, -phi, 0 },
            new float[] { -S, -phi, 0 },
            new float[] { -S, phi, 0 },
            new float[] { phi, 0, S },
            new float[] { -phi, 0, S },
            new float[] { -phi, 0, -S },
            new float[] { phi, 0, -S },
            new float[] { 0, S, phi },
            new float[] { 0, S, -phi },
            new float[] { 0, -S, -phi },
            new float[] { 0, -S, phi }
        };
        containerVertices = tmpv;

        /*
         * int[][] tmpf = new int[][]{
         *  new int[]{8,4,0},
         *  new int[]{8,0,3},
         *  new int[]{8,3,5},
         *  new int[]{8,5,11},
         *  new int[]{8,11,4},
         *  new int[]{4,7,0},
         *  new int[]{0,9,3},
         *  new int[]{3,6,5},
         *  new int[]{5,2,11},
         *  new int[]{11,1,4},
         *  new int[]{4,1,7},
         *  new int[]{0,7,9},
         *  new int[]{3,9,6},
         *  new int[]{5,6,2},
         *  new int[]{11,2,1},
         *  new int[]{10,7,1},
         *  new int[]{10,9,7},
         *  new int[]{10,6,9},
         *  new int[]{10,2,6},
         *  new int[]{10,1,2}
         * };
         */
        int[][] tmpf = new int[][] {
            new int[] { 8, 0, 4 },
            new int[] { 8, 3, 0 },
            new int[] { 8, 5, 3 },
            new int[] { 8, 11, 5 },
            new int[] { 8, 4, 11 },
            new int[] { 4, 0, 7 },
            new int[] { 0, 3, 9 },
            new int[] { 3, 5, 6 },
            new int[] { 5, 11, 2 },
            new int[] { 11, 4, 1 },
            new int[] { 4, 7, 1 },
            new int[] { 0, 9, 7 },
            new int[] { 3, 6, 9 },
            new int[] { 5, 2, 6 },
            new int[] { 11, 1, 2 },
            new int[] { 10, 1, 7 },
            new int[] { 10, 7, 9 },
            new int[] { 10, 9, 6 },
            new int[] { 10, 6, 2 },
            new int[] { 10, 2, 1 }
        };
        containerFaces = tmpf;
        container.buildMesh(containerVertices, containerFaces);
        container.roundCorners(130);
    }