[vtkusers] Re: Re: vtkProgrammableGlyphFilter problem
reyes mauricio
mreyesa at hotmail.com
Tue Feb 1 02:52:30 EST 2005
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/
More information about the vtkusers
mailing list