#1
|
|||
|
|||
Draw Line
I am trying to create lines between points moving through x to y. I created the line but these lines appear in different positions (according to the points). Is there any way to draw just a solid line between 2 points and moved with them?
Code:
viz.startlayer(viz.LINE_STRIP) viz.vertexcolor(0, .6, 0) viz.vertex(point1) viz.vertex(point2) line1-2 = viz.endlayer() Any suggestions? Thanks |
#2
|
|||
|
|||
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) |
#3
|
|||
|
|||
Darkmax,
Many thanks for your post I have done it, but my problem is to keep the lines between the points in the mainview. I used postMultLinkable function to make sure my points (that I reading from real-time) are in the mainview, this worked lovely with the points but the lines between these points left the points once I move the mainview. Is there any advices can be provided? Thanks, |
#4
|
|||
|
|||
How can I draw cylinder between 2 points by using viz.vertx?
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to invoke command line question | billjarrold | Vizard | 2 | 01-11-2010 08:51 AM |
Draw line and rotate it | Chrissy2009 | Vizard | 5 | 09-07-2009 01:10 AM |
Draw line with a triangle at the end | Chrissy2009 | Vizard | 9 | 08-24-2009 11:12 AM |
Draw Line between Points | Chrissy2009 | Vizard | 2 | 05-13-2009 04:42 AM |
Draw Line between Points selected by mouse | Johannes | Vizard | 7 | 01-07-2005 02:50 PM |