Function ArrayMesh.addSurfaceFromArrays
Creates a new surface.
Surfaces are created to be rendered using a primitive
, which may be any of the types defined in Mesh
. (As a note, when using indices, it is recommended to only use points, lines or triangles.) Mesh
will become the surf_idx
for this new surface.
The arrays
argument is an array of arrays. See arraytype
for the values used in this array. For example, arraysclass="pln">D 0
is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for constant ARRAY_INDEX
if it is used.
Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data, and the index array defines the order of the vertices.
Godot uses clockwise winding order for front faces of triangle primitive modes.