本文整理汇总了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.");
}
示例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);
}
示例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);
}
示例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
}
示例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.");
}
示例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);
}
示例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
}