Create a new VertexIterator instance.
The vertex buffer to be iterated.
Notifies the vertex buffer being iterated that writes are complete. Internally the vertex buffer is unlocked and vertex data is uploaded to video memory.
const iterator = new pc.VertexIterator(vertexBuffer);
iterator.element[pc.SEMANTIC_POSITION].set(-0.9, -0.9, 0.0);
iterator.element[pc.SEMANTIC_COLOR].set(255, 0, 0, 255);
iterator.next();
iterator.element[pc.SEMANTIC_POSITION].set(0.9, -0.9, 0.0);
iterator.element[pc.SEMANTIC_COLOR].set(0, 255, 0, 255);
iterator.next();
iterator.element[pc.SEMANTIC_POSITION].set(0.0, 0.9, 0.0);
iterator.element[pc.SEMANTIC_COLOR].set(0, 0, 255, 255);
iterator.end();
Moves the vertex iterator on to the next vertex.
Optional
count: number = 1Optional number of steps to move on when calling next. Defaults to 1.
const iterator = new pc.VertexIterator(vertexBuffer);
iterator.element[pc.SEMANTIC_POSITION].set(-0.9, -0.9, 0.0);
iterator.element[pc.SEMANTIC_COLOR].set(255, 0, 0, 255);
iterator.next();
iterator.element[pc.SEMANTIC_POSITION].set(0.9, -0.9, 0.0);
iterator.element[pc.SEMANTIC_COLOR].set(0, 255, 0, 255);
iterator.next();
iterator.element[pc.SEMANTIC_POSITION].set(0.0, 0.9, 0.0);
iterator.element[pc.SEMANTIC_COLOR].set(0, 0, 255, 255);
iterator.end();
A vertex iterator simplifies the process of writing vertex data to a vertex buffer.