This command allows you to modify the color of a specific vertex in the On-The-Fly object. The index is a number that can start from 0 and go up to, but not including, the number of vertices in the object.
Note: If you are frequently changing the color of a vertex, then use the <node3d:onthefly>.dynamic command to speed up rendering.
#Create a red triangle
viz.startLayer(viz.LINE_LOOP)
viz.vertexColor(viz.RED)
viz.vertex(-1,0,0)
viz.vertex(1,0,0)
viz.vertex(0,1,0)
triangle = viz.endLayer()
.
.
.
#Change the color of the tip to green
triangle.setVertexColor(2,viz.GREEN)