[vtkusers] Visualizing normal vectors

Andaharoo Andx_roo at live.com
Wed Dec 19 04:26:23 EST 2018


Your error said an array index went out of bounds. What line? Also I noticed
you never set the source data for the glyph. Could be unrelated to your
current error message, but a problem.

The glyph mapper takes two inputs. The glyph data (positions, normals,
scalars, etc) and the source (thing to copy). So if you want arrows as the
normals do this:

vtkSmartPointer<vtkOpenGLGlyph3DMapper> glyph3D =
vtkSmartPointer<vtkOpenGLGlyph3DMapper>::New(); 
glyph3D ->SetInputData(polydata); 
vtkSmartPointer<vtkArrowSource> glyphSource =
vtkSmartPointer<vtkArrowSource>::New();
glyphSource->Update();
glyph3D->SetSourceData(glyphSource->GetOutput());
glyph3D ->SetOrientationArray("normals"); 
glyph3D ->SetScaleFactor(0.5); 
glyph3D ->Update(); 



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html


More information about the vtkusers mailing list