[vtkusers] Problem with Accessing Vertex Normals
Brian.Dotson at netl.doe.gov
Tue Apr 29 08:41:41 EDT 2003
I have created a contour using vtk and I would like to extract the polygons and vertex normals for the contour.
I use GetPoints on the polyData to retrieve the polygon verticies. This works fine.
Then I use GetCellData->GetNormals to get the pointer to the normals. I extract the normals using normals->GetTuple. I do get normals, and part of them seem correct, but they seem out of order.
Let's say I have 2000 verticies and 2000 vertex normals, does vertex normal 500 correspond to vertex 500 in the array?
When my contour is a flat plane and all the normal vectors are the same the scene looks correct, but when I have an object say a sphere under the plane, then I get splotches on the plane and the sphere indicating that their normal vectors are wrong. This is why it seems as though the order is different for points and normals.
Has anyone else seen this?
Thanks in advance,
More information about the vtkusers