예제 #1
0
        private SimpleMesh ToMesh()
        {
            int vcount            = GetVertexCount();
            MdalVertexIterator vi = Mdal.MDAL_M_vertexIterator(this);
            VectorArray3d      v  = vi.GetVertexes(vcount);
            bool          hasColors;
            VectorArray3f c    = GetColors(vcount, out hasColors);
            SimpleMesh    mesh = new SimpleMesh();

            mesh.AppendVertices(v, null, c);
            int fcount           = GetFaceCount();
            MdalFaceIterator fi  = Mdal.MDAL_M_faceIterator(this);
            IndexArray3i     tri = fi.GetTris(fcount, Mdal.MDAL_M_faceVerticesMaximumCount(this));

            mesh.AppendTriangles(tri);
            return(mesh);
        }
예제 #2
0
 public void MakeMesh(SimpleMesh m)
 {
     m.AppendVertices(vertices, (WantNormals) ? normals : null, null, (WantUVs) ? uv : null);
     m.AppendTriangles(triangles);
 }