[vtkusers] How can I get a combination of Glyph3D and Follower?
Sylvain Jaume
sylvain.jaume at kitware.com
Tue Nov 8 08:19:45 EST 2005
Hi Rob,
You could execute the pipeline for every landmark point:
double *point;
vtkPoints *newPoints;
vtkPolyData *newPolyData;
vtkGlyph3D *glyph3D;
vtkPolyDataMapper *polyDataMapper;
vtkFollower *follower;
vtkSphereSource *sphereSource = vtkSphereSource::New();
vtkRenderer *renderer = vtkRenderer::New();
for (int i=0; i<numPoints; i++ )
{
point = landmarkPolyData->GetPoint(i);
newPoints = vtkPoints::New();
newPoints->InsertNextPoint(point);
newPolyData = vtkPolyData::New();
newPolyData->SetPoints(newPoints);
newPoints->Delete();
glyph3D = vtkGlyph3D::New();
glyph3D->SetInput(newPolyData);
newPolyData->Delete();
polyDataMapper = vtkPolyDataMapper::New();
polyDataMapper->SetInput(glyph3D->GetOutput());
glyph3D->Delete();
follower = vtkFollower::New();
follower->SetMapper(polyDataMapper);
polyDataMapper->Delete();
renderer->AddActor(follower);
follower->Delete();
}
vtkRenderWindow *renderWindow = vtkRenderWindow::New();
renderWindow->AddRender(renderer);
renderer->Delete();
renderWindow->Render();
Cheers,
Sylvain
Day, Robert wrote:
>Hi Sylvain,
>
>Yes I did, as it was the obvious thing to do. That makes my point cloud rotate (around its centre ?) as a whole to follow the camera, moving the glyphs away from where they are supposed to be.
>
>What I need is for each glyph to rotate around its centre so that they face the camera but keep their proper positions.
>
>Rob.
>
>
>
>>-----Original Message-----
>>From: Sylvain Jaume [mailto:sylvain.jaume at kitware.com]
>>Sent: Tuesday, 8 November 2005 8:04 PM
>>To: Day, Robert
>>Cc: vtkusers at vtk.org
>>Subject: Re: [vtkusers] How can I get a combination of Glyph3D and
>>Follower?
>>
>>
>>Hi Rob,
>>
>>Have you tried vtkGlyph3D -> vtkPolyDataMapper -> vtkFollower ?
>>
>>Cheers,
>>Sylvain
>>
>>
>>
><snip>
>_______________________________________________
>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