在网格中创建多边形
Contents
[
Hide
]
在网格中创建多边形
Aspose.3D for Java 允许在网格中创建多边形。为了使用该功能,API 提供了 网格 类的 创建多边形 方法。使用CreatePolygon方法,您可以创建优化的 三角形 或 四边形 多边形,而无需分配额外的内存。下面的代码段演示如何使用此功能。
This file contains 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
// For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-Java | |
// Initialize Mesh | |
Mesh mesh = new Mesh(); | |
//The old CreatePolygon needs to create a temporary array for holding the face indices | |
//mesh.createPolygon(new int[] { 0, 1, 2 }); | |
//The new overloads doesn't need extra allocation, and it's optimized internally. | |
mesh.createPolygon(0, 1, 2); | |
//Or You can create a polygon using 4 vertices(quad) | |
//mesh.CreatePolygon(0, 1, 2, 3); |