[vtkusers] display oriented points?

ALIZIER Julien AUSY julien.alizier-ausy at irsn.fr
Mon Apr 19 07:00:44 EDT 2004


Hi,

You can use vectorial point data to store your normal.

Try something like this :

vtkDoubleArray * normalArray = vtkDoubleArray::New();
normalArray->SetName("Normals");
normalArray->SetNumberOfComponents(3);
normalArray->SetNumberOfTuples(nbPoints);
for (int p = 0; p < nbPoints; p++)
{
	double normal[3] = your_calculated_normal
	normalArray->SetTuple(p, normal);
}
yourPolyData->GetPointData()->AddArray(normalArray);


HTH

-- Julien


-----Message d'origine-----
De : Chen, Elvis [mailto:anisotropic7 at yahoo.ca]
Envoyé : jeudi 15 avril 2004 22:27
À : vtkusers at vtk.org; anisotropic7 at yahoo.ca
Objet : [vtkusers] display oriented points?


hi,

feeling stupid today, so please take it easy if my
question seem to be trivial.

I want to display a set of points and oriented them
according to the point normal.  I have a file with
each line of the format being:

x, y, z, xv, yv, zv

I know I should use Glyph3D for this, and use (say)
vtkConeSource for the orientation.  Glyph3D uses
vtkPolyData for the geometry, and I can enter the
coordinate (x, y, z) using vtkPolyData->SetPoints.

But where do I put the normal (xv, yv, zv) information
in vtkPolyData?

thx,

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca
_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list