[vtkusers] glyphs and hedgehogs

Jeff Lee jeff at cdnorthamerica.com
Wed Dec 13 10:52:23 EST 2000


Great, Berk!
In addition, if you want the tails of the vectors to start at the vertex, you can use a
vtkTransform like this:
(The key is to translate the arrow, then scale the entire glyph)

   vtkGlyphSource2D* arrow = vtkGlyphSource2D::New();
   arrow->SetGlyphTypeToArrow();
   arrow->FilledOff();

   vtkTransform trans = vtkTransform()::New();
   trans->Identity();
   trans->Translate(0.5,0.0,0.0);

   vtkGlyph3D glyph = new vtkGlyph3D();
   glyph.SetInput(cc.GetOutput());
   glyph.SetSource(transFilter.GetOutput());
   glyph.SetScaleFactor(0.2);
   etc...


berk.geveci at kitware.com wrote:

>         Jim,
>
>         There is a much better way. Use vtkGlyphSource2D.
>         (You need to get a nightly release, this is not in
>         vtk 3.1.2). Here is a bit from something I am doing:
>
>   vtkGlyphSource2D* arrow = vtkGlyphSource2D::New();
>   arrow->SetGlyphTypeToArrow();
>   arrow->SetScale(0.2);
>   arrow->FilledOff();
>
> // Glyph the gradient vector
>   vtkGlyph3D* glyph = vtkGlyph3D::New();
>   glyph->SetInput(fd2ad->GetOutput());
>   glyph->SetSource(arrow->GetOutput());
>   glyph->ScalingOff();
>   glyph->OrientOn();
>   glyph->SetVectorModeToUseVector();
>   glyph->SetColorModeToColorByVector();
>
>         Berk
>
> On Tue, 12 Dec 2000 harsh at lanl.gov wrote:
>
> >
> > Hi,
> >
> > I'd like to draw arrows to represent a vector field. I can draw a cone at the
> > data point, the size or color representing the vector size; or I can draw a
> > hedgehog, whose length represents the size of the vector; or I can do both and
> > have a cone with a line protuding from the tip of the cone. HOw can I draw the
> > cone at the end of the hedghog to get an arrow?
> >
> > Thanks,
> > Jim
> >
> >
> >
> >
> > ---------------------------------------------
> > Jim Harsh  E-Mail: harsh at lanl.gov
> > Los Alamos National Laboratory, MS P940
> > Los Alamos, NM 87545
> > 505-665-0485, FAX - 505-665-3359
> > Date: 12-Dec-2000,Time: 15:50:21
> > ---------------------------------------------
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/vtkusers
> >
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers

--
J.A. Lee
Software Engineer
Computational Dynamics North America
3 Schoolhouse Lane
Etna NH, 03750
ph: 603-643-9993 x109, fax: 603-643-9994


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20001213/566651b8/attachment.htm>


More information about the vtkusers mailing list