Exemplo n.º 1
0
        /*
         * <paramref name="allVertices">List of vertices, in the same order as 'verts' from the mesh.</paramref>
         * <paramref name="tris">The tris array from the mesh.</paramref>
         * <paramref name="triIndex">The index of the first vertex in this triangle.</paramref>
         */
        public static void AddFace(List <Vertice> allVertices, int[] tris, int triIndex)
        {
            Vertice v0 = allVertices[tris[triIndex + 0]];
            Vertice v1 = allVertices[tris[triIndex + 1]];
            Vertice v2 = allVertices[tris[triIndex + 2]];

            Edge e0 = v0.GetConnectingEdge(v1);
            Edge e1 = v0.GetConnectingEdge(v2);
            Edge e2 = v1.GetConnectingEdge(v2);

            Face face = new Face(e0, e1, e2);

            e0.faces.Add(face);
            e1.faces.Add(face);
            e2.faces.Add(face);
        }