[vtk-developers] VTK 7.1 issue with vtkPoints while rendering
afnanahmad
afnanahmad at live.com
Tue Mar 14 09:11:59 EDT 2017
Here is the code I'm using, not sure which step is wrong.
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
vtkSmartPointer<vtkCellArray> cell = vtkCellArray::New();
for (size_t i = 0; i < point_cloud->points.size(); i++)
{
double point[3] = { point_cloud->points[i].x,
point_cloud->points[i].y,
point_cloud->points[i].z };
vtkIdType id = points->InsertNextPoint(point);
cell->InsertNextCell(1);
cell->InsertCellPoint(id);
}
vtkSmartPointer<vtkPolyData> polyData = vtkSmartPointer<vtkPolyData>::New();
polyData->SetPoints(points);
polyData->SetVerts(cell);
vtkSmartPointer<vtkVertexGlyphFilter> glyphFilter =
vtkSmartPointer<vtkVertexGlyphFilter>::New();
glyphFilter->SetInputData(polyData);
glyphFilter->Update();
vtkSmartPointer<vtkPolyDataMapper> mapper =
vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputConnection(glyphFilter->GetOutputPort());
vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
actor->SetMapper(mapper);
for some of the files this code is working fine.
--
View this message in context: http://vtk.1045678.n5.nabble.com/VTK-7-1-issue-with-vtkPoints-while-rendering-tp5742466p5742468.html
Sent from the VTK - Dev mailing list archive at Nabble.com.
More information about the vtk-developers
mailing list