Skapa polygon i mesh
Contents
[
Hide
]
Skapa polygon i mesh
Aspose.3D for Java tillåter att en polygon skapas i ett mesh. För att kunna använda funktionaliteten erbjuder API-metoden CreatePolygonName för Maska-klass. Genom att använda CreatePolygon-metoden kan du skapa ett optimerat Triangeln eller Quadpolygon utan att tilldela extra minne. Följande kodsnutt visar hur denna funktionalitet används.
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
// 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); |