Beispiel #1
0
        public static void SplitVertices(this IMeshBuilder meshBuilder)
        {
            var triangles = meshBuilder.Indices.ToArray();

            meshBuilder.Normals.Clear();
            meshBuilder.UVs.Clear();
            meshBuilder.Colors.Clear();

            var vertices = new Vector3[triangles.Length];

            for (int i = 0; i < triangles.Length; i++)
            {
                vertices[i]  = meshBuilder.Vertices[triangles[i]];
                triangles[i] = i;
            }

            meshBuilder.SetVertices(vertices);
            meshBuilder.SetTriangles(triangles);
        }