Mesh:getVertices

Edit

Returns the vertices in the Mesh.

vertices = Mesh:getVertices(index, count)

Arguments

NameTypeDefaultDescription
indexnumber1 The index of the first vertex to return.
countnumbernil The number of vertices to return. If nil, returns the "rest" of the vertices, based on the index argument.

Returns

NameTypeDescription
verticestable A table of vertices. Each vertex is a table of numbers for each vertex attribute, given by the vertex format of the Mesh.

Notes

This function will be very very slow if the storage mode of the Mesh is gpu, because the data will be downloaded from VRAM. A better option is to call Buffer:newReadback on the Mesh's underlying vertex buffer (Mesh:getVertexBuffer), which will download in the background instead of waiting for it to complete.

See also