|
MultiMaterialModelNodeAddSubMesh(Int32, Int32, BoundingBox, 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: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax public SubMesh AddSubMesh(
int startIndexLocation,
int indexCount,
BoundingBox subMeshBoundingBox,
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.
- subMeshBoundingBox BoundingBox
- BoundingBox of the SubMesh (when Undefined and when CalculateActualBoundingBox is true (false by default), then BoundingBox is automatically calculated)
- 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