Draw line with a triangle at the end
Hi,
I want to draw a line and at the end of this line I want to draw an arrow. I've made: Code:
viz.startlayer(viz.LINES) I looked at the tutorial "Hierarchical Models", but this does not help. I want to draw a line and at the end of this line there should be an arrow. And it should be possible to rotate the line along with the arrow. Can anybody help me - please? Thanks a lot! |
You can set the triangle's parent to be the line and then when you move or rotate the line the triangle will follow.
Code:
triangle = viz.endlayer(parent=line) |
2 Attachment(s)
Hey,
I've done this, but it does not work: Code:
viz.startlayer(viz.LINES) In 02.bmp I've described my problem. I want to draw a line and afterthat I want to draw the triangle in the local coordinate system of the line. So, that I'm able to set the triangle allways on Code:
viz.vertex(1,0,0) Hope somebody can help me. |
Oh, is there nobody who can help me??? :( :confused:
|
I don't know if it would work, but could you make the triangle vertices a function of the line vertex? Something like this:
Code:
viz.startlayer(viz.TRIANGLES) |
No, that does not work! Sorry! :mad:
|
Oh, the arrows are so important for my project.
Is there no possibility to draw these? :confused::confused::confused: |
Here is a sample script that draws arbitrary arrows on the screen. Hope this helps:
Code:
import viz |
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.... |
Is there no way to solve my problem??? :confused::confused::confused::confused:
|
All times are GMT -7. The time now is 04:56 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC