![]() |
|
|
|
#1
|
|||
|
|||
|
Oh, the arrows are so important for my project.
Is there no possibility to draw these? ![]() ![]()
|
|
#2
|
|||
|
|||
|
Here is a sample script that draws arbitrary arrows on the screen. Hope this helps:
Code:
import viz import vizmat viz.go() def addArrow(begin,end): ARROW_SIZE = 0.015 #Find distance between points d = vizmat.Distance(begin,end) #Draw arrow line viz.startlayer(viz.LINES) viz.linewidth(5) viz.vertex(0,0,0) viz.vertex(0,d,0) #Draw arrow tip viz.startlayer(viz.TRIANGLES) viz.vertex(-ARROW_SIZE,d,0) viz.vertex(0,d+(2*ARROW_SIZE),0) viz.vertex(ARROW_SIZE,d,0) #Finish drawing arrow arrow = viz.endlayer(parent=viz.SCREEN) #Place/rotate arrow to match begin end points arrow.setPosition(begin) arrow.setEuler(0,0,-vizmat.AngleToPoint(begin,end)) return arrow arrow1 = addArrow([0.2,0.2,0],[0.4,0.4,0]) arrow1.color(viz.GREEN) arrow2 = addArrow([0.6,0.2,0],[0.8,0.9,0]) arrow2.color(viz.RED) |
|
#3
|
|||
|
|||
|
Oh yes, thanks a lot!
If I draw one line, it works fine. If I draw one line and afterthat I draw a second one it works fine, too. But: If I draw the two lines and turn this lines around the y-axis and afterthat I want to draw a third line from the end of the first line to the end of the second line, than it doesn't work. I've found out, that the problem is the vizmat.AngleToPoint calculation. It works fine, if the two points are at the z-position 0. But If I turn the lines around so that the z-value is for example -0.5 then the calculation is wrong. How can I solve this problem? I want to draw to lines and turn this around the y-axis. And then I want to calculate the third line from the end of line1 to the end of line2. Thanks a lot.... |
|
#4
|
|||
|
|||
|
Is there no way to solve my problem???
![]() ![]() ![]()
|
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Draw a triangle instead of a point | Chrissy2009 | Vizard | 1 | 07-21-2009 10:46 AM |
| Create line and vertex | Chrissy2009 | Vizard | 2 | 07-20-2009 11:53 AM |
| Draw Vector in viewpoint lookat direction | Chrissy2009 | Vizard | 2 | 05-30-2009 01:50 AM |
| Draw Line between Points | Chrissy2009 | Vizard | 2 | 05-13-2009 05:42 AM |
| Draw Line between Points selected by mouse | Johannes | Vizard | 7 | 01-07-2005 03:50 PM |