Пример #1
0
        static void PlyToBinary(string infile, string outfile)
        {
            Console.Out.WriteLine("infile (ply): {0}, outfile (plybin): {1}", infile, outfile);

            var loader = new MeshLoader(infile);

            using (var stream = new FileStream(outfile, FileMode.Create))
                loader.WriteTo(stream);
        }
Пример #2
0
        static void BinaryToPly(string infile, string outfile)
        {
            Console.Out.WriteLine("infile (plybin): {0}, outfile (ply): {1}", infile, outfile);

            using (var stream = new FileStream(infile, FileMode.Open)) {
                var loader = new MeshLoader(stream);
                loader.WriteTo(outfile);
            }
        }
Пример #3
0
 public Mesh(string filename, bool binary)
 {
     try {
         MeshLoader loader = null;
         if (binary)
         {
             using (var stream = new FileStream(filename, FileMode.Open))
                 loader = new MeshLoader(stream);
         }
         else
         {
             loader = new MeshLoader(filename);
         }
         LoadMeshData(loader.Vertices, loader.Indices);
     }
     catch {
         Console.Error.WriteLine("The mesh will not contain any data");
     }
 }