Mesh:setVertex
Update a single vertex in the Mesh.
Mesh:setVertex(index, ...)
Arguments
Name | Type | Description |
index | number | The index of the vertex to set. |
... | number | The attributes of the vertex. |
Returns
Nothing
Notes
Any unspecified components will be set to 0.
Example
Set the position of a vertex:
function lovr.load()
mesh = lovr.graphics.newMesh({
{ -1, 1, 0, 0, 0, 1, 0, 0 },
{ 1, 1, 0, 0, 0, 1, 1, 0 },
{ -1, -1, 0, 0, 0, 1, 0, 1 },
{ 1, -1, 0, 0, 0, 1, 1, 1 }
}, 'strip')
mesh:setVertex(2, { 7, 7, 7 })
print(mesh:getVertex(2)) -- 7, 7, 7, 0, 0, 0, 0, 0
end
See also
Mesh:getVertex
Mesh