[vtkusers] How to correctly represent a polygon

Paulo José Correia Bernardes pbernardes at uaum.uminho.pt
Thu Feb 16 06:36:27 EST 2012


Hi David,

 

It works perfectly J!!

 

Thanks a lot!

 

Paulo

 

De: David Doria [mailto:daviddoria at gmail.com] 
Enviada: quarta-feira, 15 de Fevereiro de 2012 23:09
Para: Paulo José Correia Bernardes
Cc: vtkusers at vtk.org
Assunto: Re: [vtkusers] How to correctly represent a polygon

 

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/20120216/3c5d9b62/attachment.htm>


More information about the vtkusers mailing list