[vtkusers] How to draw lines between two datasets using VTK
David Doria
daviddoria at gmail.com
Mon Nov 21 09:32:29 EST 2011
On Mon, Nov 21, 2011 at 8:29 AM, dev <work2compilation at gmail.com> wrote:
> I think normally, perhaps I'm wrong , we I do this:
>
> *// Create a polydata to store everything in*
> vtkSmartPointer<vtkPolyData> linesPolyData =
> vtkSmartPointer<vtkPolyData>::New();
>
> *// Add the points to the dataset*
> linesPolyData->SetPoints(pts);
>
> * // Add the lines to the dataset*
> linesPolyData->SetLines(lines);
>
> I put all data (point_source and point_target and lines in the same value
> *linePloyData*, and when I display the result I will have the same result as
> the image above. But in fact I have just the lines displayed:
>
> *mapper->SetInput(linesPolyData);*
>
> Could you help me please?
You can make a separate VertexGlyphFilter (each with a Mapper and
Actor) for each set of points:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filters/vtkVertexGlyphFilter
David
More information about the vtkusers
mailing list