If you are not going to frequently modify an On-The-Fly object then this command will help speed up rendering. By default, all On-The-Fly objects are marked as static.
#Create a triangle
viz.startLayer(viz.TRIANGLES)
viz.vertex(-1,0,0)
viz.vertex(1,0,0)
viz.vertex(0,1,0)
triangle = viz.endLayer()
#The contents will be changing frequently
triangle.dynamic()
def changeVertex():
#Change the position of a vertex
triangle.setVertex(0,x,y,z)
mytimer = vizact.ontimer(0.1, changeVertex)
.
.
.
#Done modifying the object frequently
mytimer.setEnabled(viz.OFF)
triangle.static()