[vtkusers] vtkParticleReader and vtkGlyph3D

Sgouros, Thomas thomas_sgouros at brown.edu
Tue Apr 3 14:27:43 EDT 2018


Hello all:

Can someone help me understand why this code works:

  vtkSmartPointer<vtkGlyph3D> glyph3D = vtkSmartPointer<vtkGlyph3D>::New();
  glyph3D->SetSourceConnection(cubeSource->GetOutputPort());
  glyph3D->SetInputData(polydata);
  glyph3D->Update();

And this does not (nothing displayed)?

  vtkSmartPointer<vtkGlyph3D> glyph3D =  vtkSmartPointer<vtkGlyph3D>::New();
  glyph3D->SetSourceConnection(cubeSource->GetOutputPort());
  glyph3D->SetInputData(reader->GetOutput());
  glyph3D->Update();

The first clip is from
https://www.vtk.org/Wiki/VTK/Examples/Cxx/Filtering/Glyph3D

The 'reader' object is stolen from the ParticleReader example:

  vtkSmartPointer<vtkParticleReader> reader =
vtkSmartPointer<vtkParticleReader>::New();
  reader->SetFileName ( filePath.c_str() );
  reader->SetDataByteOrderToBigEndian();
  reader->Update();

The program compiles, but no data appears. It works fine (data appears) in
the context of the ParticleReader example, where it shows all the data
points. But I want to see them as glyphs, not little squares. I seem to be
misunderstanding something fundamental, but not seeing what it could be.

Many thanks,

 -Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180403/3ec88ea4/attachment.html>


More information about the vtkusers mailing list