<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Great, Berk!
<br>In addition, if you want the tails of the vectors to start at the vertex,
you can use a vtkTransform like this:
<br>(The key is to translate the arrow, then scale the entire glyph)
<p>&nbsp;&nbsp; vtkGlyphSource2D* arrow = vtkGlyphSource2D::New();
<br>&nbsp;&nbsp; arrow->SetGlyphTypeToArrow();
<br>&nbsp;&nbsp; arrow->FilledOff();
<p>&nbsp;&nbsp; vtkTransform trans = vtkTransform()::New();
<br>&nbsp;&nbsp; trans->Identity();
<br>&nbsp;&nbsp; trans->Translate(0.5,0.0,0.0);
<p>&nbsp;&nbsp; vtkGlyph3D glyph = new vtkGlyph3D();
<br>&nbsp;&nbsp; glyph.SetInput(cc.GetOutput());
<br>&nbsp;&nbsp; glyph.SetSource(transFilter.GetOutput());
<br>&nbsp;&nbsp; glyph.SetScaleFactor(0.2);
<br>&nbsp;&nbsp; etc...
<br>&nbsp;
<p>berk.geveci@kitware.com wrote:
<blockquote TYPE=CITE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Jim,
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; There is a much better way.
Use vtkGlyphSource2D.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (You need to get a nightly
release, this is not in
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtk 3.1.2). Here is a bit
from something I am doing:
<p>&nbsp; vtkGlyphSource2D* arrow = vtkGlyphSource2D::New();
<br>&nbsp; arrow->SetGlyphTypeToArrow();
<br>&nbsp; arrow->SetScale(0.2);
<br>&nbsp; arrow->FilledOff();
<p>// Glyph the gradient vector
<br>&nbsp; vtkGlyph3D* glyph = vtkGlyph3D::New();
<br>&nbsp; glyph->SetInput(fd2ad->GetOutput());
<br>&nbsp; glyph->SetSource(arrow->GetOutput());
<br>&nbsp; glyph->ScalingOff();
<br>&nbsp; glyph->OrientOn();
<br>&nbsp; glyph->SetVectorModeToUseVector();
<br>&nbsp; glyph->SetColorModeToColorByVector();
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Berk
<p>On Tue, 12 Dec 2000 harsh@lanl.gov wrote:
<p>>
<br>> Hi,
<br>>
<br>> I'd like to draw arrows to represent a vector field. I can draw a
cone at the
<br>> data point, the size or color representing the vector size; or I
can draw a
<br>> hedgehog, whose length represents the size of the vector; or I can
do both and
<br>> have a cone with a line protuding from the tip of the cone. HOw can
I draw the
<br>> cone at the end of the hedghog to get an arrow?
<br>>
<br>> Thanks,
<br>> Jim
<br>>
<br>>
<br>>
<br>>
<br>> ---------------------------------------------
<br>> Jim Harsh&nbsp; E-Mail: harsh@lanl.gov
<br>> Los Alamos National Laboratory, MS P940
<br>> Los Alamos, NM 87545
<br>> 505-665-0485, FAX - 505-665-3359
<br>> Date: 12-Dec-2000,Time: 15:50:21
<br>> ---------------------------------------------
<br>>
<br>> _______________________________________________
<br>> This is the private VTK discussion list.
<br>> Please keep messages on-topic. Check the FAQ at: &lt;<a href="http://public.kitware.com/cgi-bin/vtkfaq">http://public.kitware.com/cgi-bin/vtkfaq</a>>
<br>> Follow this link to subscribe/unsubscribe:
<br>> <a href="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/mailman/listinfo/vtkusers</a>
<br>>
<p>_______________________________________________
<br>This is the private VTK discussion list.
<br>Please keep messages on-topic. Check the FAQ at: &lt;<a href="http://public.kitware.com/cgi-bin/vtkfaq">http://public.kitware.com/cgi-bin/vtkfaq</a>>
<br>Follow this link to subscribe/unsubscribe:
<br><a href="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/mailman/listinfo/vtkusers</a></blockquote>

<pre>--&nbsp;
J.A. Lee
Software Engineer
Computational Dynamics North America
3 Schoolhouse Lane
Etna NH, 03750
ph: 603-643-9993 x109, fax: 603-643-9994</pre>
&nbsp;</html>