 |
MultiMaterialModelNodeAddSubMesh(Int32, Int32, Material, Material, String) Method |
AddSubMesh method adds a new
SubMesh that will render triangles with the specified start index and index count.
Note that index numbers are not triangle indexes but indexes in the IndexBuffer.
For example to set start location to the second triangle, set startIndexLocation to 3 (indices from 0 to 2 define the first triangle).
Namespace: Ab4d.SharpEngine.SceneNodesAssembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 4.1.9680+a1b1e43de1ad9a7e35472c33948d688d7b40ef79
Syntaxpublic SubMesh AddSubMesh(
int startIndexLocation,
int indexCount,
Material? material = null,
Material? backMaterial = null,
string? subMeshName = null
)
Parameters
- startIndexLocation Int32
- Start index in IndexBuffer in the Mesh. Note that index numbers are not triangle indexes but indices in the IndexBuffer. For example to set start location to the second triangle, set StartIndexLocation to 3 (indices from 0 to 2 define the first triangle).
- indexCount Int32
- Number of triangle indices to render. For example, when set to 6, then 2 triangles will be rendered.
- material Material (Optional)
- optional material that used to render the front side of the triangles
- backMaterial Material (Optional)
- optional material that used to render the back side of the triangles
- subMeshName String (Optional)
- optional SubMesh name
Return Value
SubMeshCreated SubMesh
See Also