You need to declare the
oldLocs variable as global. Your code should look like the following:
Code:
oldLocs = [ [0,0,0] for x in range(numLights) ] #Initialize to some value
def mytimer(num):
global oldLocs
newLocs = []
for x in range(numLights):
newLoc = balls[x].get(viz.POSITION)
newLocs.append(newLoc)
viz.startlayer(viz.LINES)
viz.vertexcolor(1,0,1)
viz.linewidth(1)
#print 'newLocs[',x,']',newLocs[x]
viz.vertex(newLoc)
viz.vertex(0,0,0)
tail = viz.endlayer()
tails.append(tail)
tail.size(0,0,0,1,viz.TIME)
oldLocs = newLocs