![]() |
![]() |
![]() |
Mesh.Split Method |
Language: |
Splits a mesh into multiple meshes that are smaller than the specified size.
Visual Basic .NET Public Shared Function Split( _
ByVal mesh As Mesh, _
ByVal adjacencyIn() As Integer, _
ByVal maxSize As Integer, _
ByVal options As MeshFlags _
) As Mesh()C# public static Mesh[] Split(
Mesh mesh,
int[] adjacencyIn,
int maxSize,
MeshFlags options
);Managed C++ public: static Mesh* Split(
Mesh *mesh,
int adjacencyIn __gc[],
int maxSize,
MeshFlags options
) __gc[];JScript .NET public static function Split(
mesh : Mesh,
adjacencyIn : int[],
maxSize : int,
options : MeshFlags
) : Mesh[];
mesh Microsoft.DirectX.Direct3D.Mesh. A Mesh object that represents the source mesh. adjacencyIn System.Int32[]. Array of three Int32 values per face that specify the three neighbors for each face in the mesh to be simplified.
maxSize System.Int32. Maximum number of vertices in the resulting mesh. options Microsoft.DirectX.Direct3D.MeshFlags. One or more of the Option*MeshFlags for the new meshes.
Microsoft.DirectX.Direct3D.Mesh[]. Array of Mesh objects for the new meshes. For a source mesh split into n meshes, the ret_MeshA value is an array of nMesh objects.
This method is commonly used to split a mesh with 32-bit indices (more than 65,535 vertices) into multiple meshes, each of which has 16-bit indices.
The param_GraphicsStreamR_adjacencyArrayOut, param_GraphicsStreamR_vertRemapArrayOut, and param_GraphicsStreamR_faceRemapArrayOut arrays have two dimensions. The first dimension specifies the mesh, and the second specifies the data. For example, to obtain the face remap information for face 3 in mesh 2, the following C# code could be used, assuming the face remap data is returned in a variable named faceRemapArrayOut.
[C#]
int remap = FaceRemapArrayOut[2][3];
Exceptions
InvalidCallException The method call is invalid. For example, a method's parameter might contain an invalid value. InvalidDataException The data is invalid. OutOfMemoryException Microsoft® Direct3D® could not allocate sufficient memory to complete the call.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center