Mesh:getVertices
EditReturns the vertices in the Mesh.
vertices = Mesh:getVertices(index, count)
Arguments
Name | Type | Default | Description |
index | number | 1 | The index of the first vertex to return. |
count | number | nil |
The number of vertices to return. If nil, returns the "rest" of the vertices, based on the index argument.
|
Returns
Name | Type | Description |
vertices | table | 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 callBuffer:newReadback
on the Mesh's underlying vertex buffer (Mesh:getVertexBuffer
), which will download in the background instead of waiting for it to complete.