Mesh.CreatePolygon

CreatePolygon(int[], int, int)

Creates a new polygon with all vertices defined in indices. To create polygon vertex by vertex, please use PolygonBuilder.

public void CreatePolygon(int[] indices, int offset, int length)
ParameterTypeDescription
indicesInt32[]Array of the polygon indices, each index points to a control point that forms the polygon.
offsetInt32The offset of the first polygon index
lengthInt32The length of the indices

Examples

The following code shows how to create a new polygon with control point’s indices.

var mesh = new Mesh();
int[] indices = new int[] {0, 1, 2};
mesh.CreatePolygon(indices);

See Also


CreatePolygon(int[])

Creates a new polygon with all vertices defined in indices. To create polygon vertex by vertex, please use PolygonBuilder.

public void CreatePolygon(int[] indices)
ParameterTypeDescription
indicesInt32[]Array of the polygon indices, each index points to a control point that forms the polygon.

Examples

var mesh = new Mesh();
int[] indices = new int[] {0, 1, 2};
mesh.CreatePolygon(indices);

See Also


CreatePolygon(int, int, int, int)

Create a polygon with 4 vertices(quad)

public void CreatePolygon(int v1, int v2, int v3, int v4)
ParameterTypeDescription
v1Int32Index of the first vertex
v2Int32Index of the second vertex
v3Int32Index of the third vertex
v4Int32Index of the fourth vertex

Examples

The following code shows how to create a new polygon with control point’s indices.

var mesh = new Mesh();
mesh.CreatePolygon(0, 1, 2, 3);

See Also


CreatePolygon(int, int, int)

Create a polygon with 3 vertices(triangle)

public void CreatePolygon(int v1, int v2, int v3)
ParameterTypeDescription
v1Int32Index of the first vertex
v2Int32Index of the second vertex
v3Int32Index of the third vertex

Examples

The following code shows how to create a new polygon with control point’s indices.

var mesh = new Mesh();
mesh.CreatePolygon(0, 1, 2);

See Also