当前位置: 首页>>代码示例>>C#>>正文


C# Scene.Open方法代码示例

本文整理汇总了C#中Scene.Open方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.Open方法的具体用法?C# Scene.Open怎么用?C# Scene.Open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Scene的用法示例。


在下文中一共展示了Scene.Open方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Run

        public static void Run()
        {
            // ExStart:Save3DScene
            // The path to the documents directory.
            string MyDir = RunExamples.GetDataDir();
                        
            // Load a 3D document into Aspose.3D
            Scene scene = new Scene();

            // Open an existing 3D scene
            scene.Open(MyDir + "document.fbx");

            // Save Scene to a stream
            MemoryStream dstStream = new MemoryStream();
            scene.Save(dstStream, FileFormat.FBX7500ASCII);
            
            // Rewind the stream position back to zero so it is ready for next reader.
            dstStream.Position = 0;

            // Save Scene to a local path
            scene.Save(MyDir + "output_out.fbx", FileFormat.FBX7500ASCII);
            // ExEnd:Save3DScene

            Console.WriteLine("\nConverted 3D document to stream successfully.");
        }
开发者ID:aspose-3d,项目名称:Aspose.3D-for-.NET,代码行数:25,代码来源:Save3DScene.cs

示例2: Run

 public static void Run()
 {
     // ExStart:TriangulateMesh 
     // The path to the documents directory.
     string MyDir = RunExamples.GetDataDir();
    
     // Initialize scene object
     Scene scene = new Scene();
     scene.Open(MyDir + "document.fbx");
     
     scene.RootNode.Accept(delegate(Node node)
     {
         Mesh mesh = node.GetEntity<Mesh>();
         if (mesh != null)
         {
             // Triangulate the mesh
             Mesh newMesh = PolygonModifier.Triangulate(mesh);
             // Replace the old mesh
             node.Entity = mesh;
         }
         return true;
     });
     MyDir = MyDir + RunExamples.GetOutputFilePath("document.fbx");
     scene.Save(MyDir, FileFormat.FBX7400ASCII);
     // ExEnd:TriangulateMesh   
     Console.WriteLine("\nMesh has been Triangulated.\nFile saved at " + MyDir);
 }
开发者ID:aspose-3d,项目名称:Aspose.3D-for-.NET,代码行数:27,代码来源:TriangulateMesh.cs

示例3: Run

 public static void Run()
 {
     // ExStart:FlipCoordinateSystem
     // The path to the documents directory.
     string MyDir = RunExamples.GetDataDir();            
     // Initialize scene object
     Scene scene = new Scene();
     scene.Open(MyDir + "camera.3ds", FileFormat.Discreet3DS);
     MyDir = MyDir + "FlipCoordinateSystem.obj";
     scene.Save(MyDir, FileFormat.WavefrontOBJ);
     // ExEnd:FlipCoordinateSystem
     Console.WriteLine("\nCoordinate system has been flipped successfully.\nFile saved at " + MyDir);
 }
开发者ID:aspose-3d,项目名称:Aspose.3D-for-.NET,代码行数:13,代码来源:FlipCoordinateSystem+.cs

示例4: Run

 public static void Run()
 {
     // ExStart:OpenSceneFromProtectedPdf
     // The path to the documents directory.
     string MyDir = RunExamples.GetDataDir();
     // Create a new scene
     Scene scene = new Scene();
     // Use loading options and apply password
     PdfLoadOptions opt = new PdfLoadOptions() { Password = Encoding.UTF8.GetBytes("password") };
     // Open scene
     scene.Open(MyDir + "House_Design.pdf", opt);
     // ExEnd:OpenSceneFromProtectedPdf            
 }
开发者ID:aspose-3d,项目名称:Aspose.3D-for-.NET,代码行数:13,代码来源:OpenSceneFromProtectedPdf.cs

示例5: Run

        public static void Run()
        {
            // ExStart:ReadExistingScene
            // The path to the documents directory.
            string MyDir = RunExamples.GetDataDir();
            MyDir = MyDir + "document.fbx";

            // Initialize a Scene class object
            Scene scene = new Scene();
            // Load an existing 3D document
            scene.Open(MyDir + "document.fbx");

            // ExEnd:ReadExistingScene
            Console.WriteLine("\n3D Scene is ready for the modification, addition or processing purposes.");
        }
开发者ID:aspose-3d,项目名称:Aspose.3D-for-.NET,代码行数:15,代码来源:ReadExistingScene.cs

示例6: OnConvert

        private void OnConvert(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tbInput.Text))
            {
                MessageBox.Show(this, "Input file is not specified.", "Convert", MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
                return;
            }
            if (string.IsNullOrEmpty(tbOutput.Text))
            {
                MessageBox.Show(this, "Input file is not specified.", "Convert", MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
                return;
            }

            Scene scene = new Scene();
            scene.Open(tbInput.Text, loadOptions);
            scene.Save(tbOutput.Text, saveOptions);
                MessageBox.Show(this, "File converted.", "Convert", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
开发者ID:aspose-3d,项目名称:Aspose.3D-for-.NET,代码行数:20,代码来源:Form1.cs

示例7: glTFLoadOptions

 public static void glTFLoadOptions()
 {
     // ExStart:glTFLoadOptions
     // The path to the documents directory.
     string MyDir = RunExamples.GetDataDir();
     // Initialize Scene class object
     Scene scene = new Scene();
     // Set load options
     GLTFLoadOptions loadOpt = new GLTFLoadOptions();
     // The default value is true, usually we don't need to change it. Aspose.3D will automatically flip the V/T texture coordinate during load and save.       
     loadOpt.FlipTexCoordV = true;
     scene.Open( MyDir + "Duck.gltf", loadOpt);
     // ExEnd:glTFLoadOptions
 } 
开发者ID:aspose-3d,项目名称:Aspose.3D-for-.NET,代码行数:14,代码来源:LoadOptions.cs


注:本文中的Scene.Open方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。