static XmlNode WriteMesh(COLLADAMesh mesh, XmlNode MeshNode, XmlDocument xDoc, string path) { for (int i = 0; i < mesh.sources.Length; i++) { XmlNode SourceNode = xDoc.CreateElement("source"); MeshNode.AppendChild(SourceNode); WriteSource(mesh.sources[i], SourceNode, xDoc); xDoc.Save(path); print("saving sources"); } print(mesh.vertices + " number of vertices"); print(mesh.sources.Length + " < length of sources"); print(mesh.sources[0] + " < mesh.sources 1st array"); //print (mesh.sources[1] + " < 2nd in array"); XmlNode VertsNode = WriteVertices(mesh.vertices, mesh.sources[0].id, mesh.sources[0].id, xDoc); // changed 1 to 0 to test MeshNode.AppendChild(VertsNode); xDoc.Save(path); print("saving vertices"); for (int i = 0; i < mesh.triangles.Length; i++) { XmlNode TrisNode = WriteTriangles(mesh.triangles[i], mesh.vertices.id, xDoc); MeshNode.AppendChild(TrisNode); xDoc.Save(path); print("saving triangles"); } print("Writing Mesh"); return(MeshNode); }
static XmlNode WriteMesh(COLLADAMesh mesh, XmlNode MeshNode, XmlDocument xDoc, string path) { for (int i = 0; i < mesh.sources.Length; i++) { XmlNode SourceNode = xDoc.CreateElement("source"); MeshNode.AppendChild(SourceNode); WriteSource(mesh.sources[i], SourceNode, xDoc); xDoc.Save(path); } XmlNode VertsNode = WriteVertices(mesh.vertices, mesh.sources[0].id, mesh.sources[1].id, xDoc); MeshNode.AppendChild(VertsNode); xDoc.Save(path); for (int i = 0; i < mesh.triangles.Length; i++) { XmlNode TrisNode = WriteTriangles(mesh.triangles[i], mesh.vertices.id, xDoc); MeshNode.AppendChild(TrisNode); xDoc.Save(path); } return(MeshNode); }
public Geometry(string id, string name) { this.id = id; this.name = name; this.mesh = null; }