I have some point cloud files in .xyz format. Each of these files contain
approximately 1million points and corresponding normal vectors for each
point. Each line of .xyz files belongs to one point and each line contains
cartesian coordinates (x,y, and z) and normal vetor (nx,ny, and nz). My
objective is to show points and their normal vectors. I can read .xyz files
successfully and show points successfully. However, I can not show normal
vectors successfully. I tried to solve the problem using vtkGlyph3D class as
shown in some examples of Kitware but every attempt was failure for me. My
code is shown below.
Could you please help me about solving this problem? I am looking forward to
hearing from you. Thanks in advance.
I'd recommend using vtkOpenGLGlyph3DMapper instead. Much faster, assuming you
have some gpu. Just make sure the normal array/orientation array is in the
input polyData's point data.
polyData->GetPointData()->AddArray(your normal array)
Then just specify the array the mapper should use with
SetOrientationArray(your arrays name here). It will then search for the
array in the input polydata. I frequently use this to draw thousands of
oriented arrows with VTK.
Thank you for your recommendation. I tried to modify my codes according to
your recommendations, my code is getting compiled successfully. However,
when I run it I am getting an error message. The screenshot and my code are
below. Could you please tell me what is wrong with my code?
Thanks in advance
Thank you very much for recommendations. My code works successfully and it
runs quite fast.
I have one more question. Is it possible to set width of arrows? I can scale
it using SetScaleFactor(). I tried SetTipLength and SetTipRadius but
dimensions did not change.
Thanks in advance