[vtkusers] vtkProgrammableGlyphFilter problem

Malcolm Drummond malcolm at geovision.co.za
Mon Jan 31 12:01:58 EST 2005


Hi

You need to add a translation to your transform - by the point's x,y,z.
Currently you're just scaling by the same amount every time at the origin,
so it looks like one glyph.

HTH
Malcolm

----- Original Message -----
From: "reyes mauricio" <mreyesa at hotmail.com>
To: <vtkusers at vtk.org>
Sent: Monday, January 31, 2005 6:36 PM
Subject: [vtkusers] vtkProgrammableGlyphFilter problem


> 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();
>
> }
>
> _________________________________________________________________
> Consigue aquí las mejores y mas recientes ofertas de trabajo en América
> Latina y USA: http://latam.msn.com/empleos/
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list