[vtkusers] Glyphs on structuredGrid cell centers

Sebastian Gatzka sebastian.gatzka at stud.tu-darmstadt.de
Mon Feb 22 07:26:35 EST 2010


Hello, me again.

This time I'm facing trouble visualizing glyphs on my structured grid.
Suppose I have done it right there is some vector data:

vtkFloatArray *v2 = vtkFloatArray::New();
v2->SetNumberOfComponents(3);
for (unsigned i = 0; i < noCells; i++){
     v2->InsertNextTuple3(i,i,i);
}

assigned to the structured grid cell centers:

sGrid->GetCellData()->SetVectors(v2);

Now creating some glyphs

vtkConeSource *cone = vtkConeSource::New();
cone->SetResolution(6);

vtkGlyph3D *glyph = vtkGlyph3D::New();
glyph->SetInput(*sGrid*);
glyph->SetSourceConnection(cone->GetOutputPort());
glyph->SetVectorModeToUseNormal();
glyph->SetScaleModeToScaleByVector();
glyph->SetScaleFactor(0.25);

results in some arrows located at the structured grid points (sGrid) 
instead of the cell centers.

    * So how do I give vtkGlyph3D the cell centers of the structured
      grid as input?
    * And how does the gylph filter know it should represent the vector
      data?!

Sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100222/ff0b19bf/attachment.htm>


More information about the vtkusers mailing list