[vtkusers] vtkProgrammableGlyphFilter problem

reyes mauricio mreyesa at hotmail.com
Mon Jan 31 11:53:59 EST 2005


Hi VTK Users,

   I'm using vtkProgrammableGlyphFilter to manipulate individually (via 
setGlyphMethod) scaling and orientation of spheres.

  I cannot make the filter to work, it only gives me one single sphere as 
output

( vtkGlyph3D works well wit the input data I pass. It copy the sphere at 
different positions, but I need to scale them and orient them differently )

Thanks in advance,
  Mauricio

this is part of my code:


// ********* part of code ************

   vtkSphereSource *sphere=vtkSphereSource::New();
   vtkProgrammableGlyphFilter *pfilter=vtkProgrammableGlyphFilter::New();
   pfilter->SetSource(sphere->GetOutput());
   pfilter->SetInput(pd);       <-------- pd (vtkPolyData)
   pfilter->SetGlyphMethod(func,(void *)pfilter);

  vtkPolyDataMapper *glyphMapper=vtkPolyDataMapper::New();
  glyphMapper->SetInput(pfilter->GetOutput());

  vtkActor *glyphActor=vtkActor::New();
  glyphActor->SetMapper(glyphMapper);

for the moment the function passed to SetGlyphMethod just scales:

void static func(void *arg)
{
  vtkProgrammableGlyphFilter *pfilter=(vtkProgrammableGlyphFilter*)arg;

//float point[3];
//pfilter->GetPoint(point);

vtkTransform *tr=vtkTransform::New();
  tr->Scale(4,1,1); // testing

  vtkTransformPolyDataFilter *pdf=vtkTransformPolyDataFilter::New();
  pdf->SetInput(pfilter->GetSource());
  pdf->SetTransform(tr);

  tr->Delete();
  pdf->Delete();

}

_________________________________________________________________
Charla con tus amigos en línea mediante MSN Messenger: 
http://messenger.latam.msn.com/




More information about the vtkusers mailing list