[vtkusers] normal of a point or cell

Sebastien BARRE seb-ml-vtk at barre.nom.fr
Fri Dec 15 15:57:07 EST 2000


At 15/12/2000 15:32, Chris Tsui wrote:
>Dear All,
>
>I posted this question few days ago...  getting no reply..  I guess this 
>is kind of stupid that no one would bother to answer..  but I am still 
>struggling with this problem..  anyways.. here's my question again :
>
>- I would like to get the normal whenever I click on the surface of the 
>mesh I have..  I can get the cell id or the world coordinates without 
>problem..  what I am struggling with is how to retrieve the normal of a 
>specific cell??  any idea??

It's in the book or the user guide, but sure.
Normals are attribute data. Attribute data are scalars, vectors, normals, 
tensors, texture coords, field data. There are 2 sets of attribute data, 
one is attached to points, the other to cells.
If "input" is your dataset, then :
input->GetCellData()->GetNormals()->GetNormal(id)
does the trick. id is the id of the cell.






More information about the vtkusers mailing list