[vtkusers] Re: Re: vtkProgrammableGlyphFilter problem

Malcolm Drummond malcolm at geovision.co.za
Tue Feb 1 08:59:32 EST 2005


Hi Mauricio

I sent a second message - the transform is having no effect. If you want to
use this approach you must create the vtkTransform and vtkTransformPolyData
filters as part of the pipeline, used as the source into the
vtkProgrammableGlyphFilter. See Graphics\Testing\Tcl\progGlyphsBySource.Tcl
for an example.

HTH
Malcolm

----- Original Message -----
From: "reyes mauricio" <mreyesa at hotmail.com>
To: <vtkusers at vtk.org>
Sent: Tuesday, February 01, 2005 9:52 AM
Subject: [vtkusers] Re: Re: vtkProgrammableGlyphFilter problem


>
>   Hi,
>        The problem still persists after trying what you recommend me
Malcolm
> (add a translation to the transform filter). I only get one single sphere
as
> output of vtkProgrammableGlyphFilter.
>         Does the vtkProgrammableGlyphFilter duplicate the source data at
> each point by itself, or do I have to perform that task?
>
>    thanks in advance,
>      Mauricio
>
> >
> >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