[vtk-developers] VTK 7.1 issue with vtkPoints while rendering
Ken Martin
ken.martin at kitware.com
Tue Mar 14 09:22:27 EDT 2017
Looks fine to me except that you can yank the vertexglyph as it is not
doing anything for you. The polydata can go directly into the mapper.
Maybe your points have a really large values and you are running into
floating point issues. Look at the bounds on your points. Could be
something else but the basic code looks OK to me.
On Tue, Mar 14, 2017 at 9:11 AM, afnanahmad <afnanahmad at live.com> wrote:
> 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.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers
>
>
--
Ken Martin PhD
Chairman & CFO
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065
518 371 3971
This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee. Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170314/07f432e7/attachment.html>
More information about the vtk-developers
mailing list