Esempio n. 1
0
 void updateContainerMesh()
 {
     container.buildMesh(containerVertices, containerFaces);
     container.roundEdges(roundEdges);
     container.roundCorners(roundCorners);
     drawMesh();
 }
Esempio n. 2
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);
    }