Thread: Draw Line
View Single Post
  #2  
Old 03-26-2010, 09:58 AM
Darkmax Darkmax is offline
Member
 
Join Date: Feb 2010
Posts: 108
I think you have to use the method setVertex for the line that you created
this code is a example of a line that moves in X

Code:
import viz

viz.go()

viz.startlayer(viz.LINE_STRIP)
viz.vertexcolor(0, 0.6, 0)
#This is vertex 0
viz.vertex([0,0,0])
#This is vertex 1
viz.vertex([1,1,0])
line = viz.endlayer()

x=0
def moveLine():
	global x
	line.setVertex(0,[0+x,0,0])#setVertex(vertex id,[x,y,z])
	line.setVertex(1,[1+x,1,0])
	x = x+1
vizact.ontimer(1,moveLine)
Reply With Quote