public class VertexElementMaterial extends VertexElement
VertexElementMaterial is used to render different part of the geometry in different materials.
Example:
The following code shows how to assign different material to different face of a box.
// Create a mesh of box(A box is composed by 6 planes)
Mesh box = (new Box()).ToMesh();
// Create a material element on this mesh
VertexElementMaterial mat = (VertexElementMaterial)box.CreateElement(VertexElementType.Material, MappingMode.Polygon, ReferenceMode.Index);
// And specify different material index for each plane
mat.Indices.AddRange(new int[] { 0, 1, 2, 3, 4, 5 });
| Constructor and Description |
|---|
VertexElementMaterial()
Initializes a new instance of the
VertexElementMaterial class. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all elements from the direct and the index arrays.
|
VertexElement |
clone(boolean withDirect,
boolean withIndice)
Deep clone the vertex element
|
clone, getIndices, getMappingMode, getName, getReferenceMode, getVertexElementType, setIndices, setMappingMode, setName, setReferenceMode, toStringpublic VertexElementMaterial()
VertexElementMaterial class.public void clear()
clear in class VertexElementpublic VertexElement clone(boolean withDirect, boolean withIndice)
VertexElementwithDirect - Clone the vertex with direct arraywithIndice - Clone the vertex with index array