Beispiel #1
0
        public void Export(object sender, EventArgs args)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Filter = "Supported Formats|*.bfobj;*.fbx;*.dae; *.obj;|" +
                         "Bfres Object (shape/vertices) |*.bfobj|" +
                         "FBX |*.fbx|" +
                         "DAE |*.dae|" +
                         "OBJ |*.obj|" +
                         "All files(*.*)|*.*";
            sfd.DefaultExt = ".bfobj";
            sfd.FileName   = Text;

            if (sfd.ShowDialog() == DialogResult.OK)
            {
                string ext = System.IO.Path.GetExtension(sfd.FileName);
                ext = ext.ToLower();

                switch (ext)
                {
                case ".bfobj":
                    ExportBinaryObject(sfd.FileName);
                    break;

                default:
                    AssimpData assimp = new AssimpData();
                    assimp.SaveFromObject(vertices, lodMeshes[DisplayLODIndex].faces, Text, sfd.FileName);
                    break;
                }
            }
        }