Hi Eugene,<br><br>Thanks for your reply. The data I am using are more than 1000 points (latitudes and longitudes), 3 polygons. The polygons are ordered counter-clockwise. I put them into a .vtk file and read it from my code. The main part of my code to do this is as follows.
<br><br>//Read the vtk data file.<br>vtkPolyDataReader *usa = vtkPolyDataReader::New();<br>usa->SetFileName("greatlakes.vtk");<br><br>//clean polydata<br>vtkCleanPolyData *cleaner = vtkCleanPolyData::New();<br>
cleaner->SetInputConnection(usa->GetOutputPort());<br> cleaner->SetTolerance(0.005);<br> <br>//apply triangle filter<br> vtkTriangleFilter *triangle = vtkTriangleFilter::New();<br> triangle->SetInputConnection(cleaner->GetOutputPort());
<br><br>//map to polydata mapper<br> vtkSmartPointer<vtkPolyDataMapper> polyMapper = vtkSmartPointer<vtkPolyDataMapper>::New();<br> polyMapper->SetInputConnection(triangle->GetOutputPort());<br>
<br>I am guessing the polygon is not convex. Is there anything I can do to draw the polygons properly?<br><br>Janny<br><br> <br><br><div><span class="gmail_quote">On 9/30/07, <b class="gmail_sendername">Eugene Dorfman</b>
<<a href="mailto:justadreamer2007@gmail.com">justadreamer2007@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Please attach some code dealing with your polygons - how are you trying
to draw them. Seems that the order of the points is either incorrect
when specifying them to the vtkPolyData - or you are using the
triangulation strip. All you need to do is to load a polygon into a
cellarray - and define it as a single cell - than pass it to
vtkPolyData. It also might be that the polygon shape is not convex -
that is why. Some code would be helpful.
</blockquote></div><br>