将 3D 模型中的所有多边形转换为三角形
Contents
[
Hide
]
Aspose.3D for Java API 支持在任何受支持的 3D 文档中将所有多边形转换为三角形。
将所有多边形转换为三角形
我们在 PolygonModifier
类中添加了另一个triangulate方法的重载,它将 Scene
类对象作为参数,如下代码示例所示:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The path to the documents directory. | |
String MyDir = RunExamples.getDataDir(); | |
// Load an existing 3D file | |
Scene scene = new Scene(MyDir + "document.fbx"); | |
// Triangulate a scene | |
PolygonModifier.triangulate(scene); | |
// Save 3D scene | |
scene.save(MyDir + "triangulated_out.fbx", FileFormat.FBX7400ASCII); |