[vtkusers] How to correctly represent a polygon

David Doria daviddoria at gmail.com
Wed Feb 15 18:09:29 EST 2012


2012/2/15 Paulo José Correia Bernardes <pbernardes at uaum.uminho.pt>

> Hi,****
>
> ** **
>
> I’m a very inexperienced VTK-user and I’m facing a small problem.****
>
> ** **
>
> I’m trying to represent an arbitrary polygon using VTKPolygon. First, I
> read the 3D points from a .xyz file (each line is a 3D point). The points
> are stored in an instance of vtkPoints and afterwards the polygon is
> constructed using VTKPolygon.****
>
> ** **
>
> However, the resulting polygon has some “strange” rendering effects, as
> you can see in the attached jpg-file.****
>
> ** **
>
> Can someone please explain me what I’m probably doing wrong and the
> correct steps I should take?****
>
> ** **
>
> Thank you very much!****
>
> ** **
>
> Yours,****
>
> ** **
>
> Paulo
>

OpenGL does not deal well with polygons that have points that are not
exactly coplanar. You could add this polygon to a vtkPolyData and then use
the vtkTriangleFilter to triangulate the polygon so that OpenGL handles it
better.

Let us know if that helps.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120215/aac7ca2d/attachment.htm>


More information about the vtkusers mailing list