[vtkusers] How to draw 3D arrow through two points?

Stephan Scholze sscholze at vision.ee.ethz.ch
Tue May 21 03:37:54 EDT 2002


Dear All,

	I would like to draw an arrow given by two 3D Points using the Tcl 
wrapper. Suppose the coordinates of the points are stored in Tcl lists like:

set p1 [list 0 0 0]
set p2 [list 0 0.2 0.8]

The arrow gemoetry is created the usual way:

vtkCylinderSource cyl
cyl SetResolution 10
cyl SetRadius .2
cyl SetHeight 2

vtkTransform cylTrans
cylTrans Identity
cylTrans RotateZ  90
cylTrans Translate  0 1.5 0

vtkTransformPolyDataFilter cylTransFilter
cylTransFilter SetInput [cyl GetOutput ]
cylTransFilter SetTransform cylTrans

vtkConeSource cone
cone SetResolution 10

vtkAppendPolyData arrow
arrow AddInput [cylTransFilter GetOutput ]
arrow AddInput [cone GetOutput]
arrow Update

But now I'm at a loss since I've no idea how to proceed.

Thank you very much in advance,

	Stephan


PS: I use vtk version 3.2, hence vtkArrowSource is no option for me.




More information about the vtkusers mailing list