[vtk-developers] Glyph mapper bug
David Thompson
david.thompson at kitware.com
Fri Feb 19 16:44:22 EST 2016
Hi all,
I've run into an issue with the Glyph3DMapper when using multiple sources; it looks like the *source-index array* is being normalized using the *scaling array's* range:
index = static_cast<int>((value-this->Range[0])*numberOfSources/den);
Both Range[0] and den refer to the values used for scaling glyphs, not choosing a glyph source. Both the OpenGL and OpenGL2 mappers appear to do this:
https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/OpenGL/vtkOpenGLGlyph3DMapper.cxx#L492
https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/OpenGL2/vtkOpenGLGlyph3DMapper.cxx#L483
I assume this is a bug and that the mappers should either
1. not do any normalization... just round and clamp the index array values or
2. normalize using the range of the index array instead of the scaling array.
3. be properly documented if no scaling is allowed in multi-source mode.
Any preferences? I think #1 makes the most sense; it's faster and if you really need to preprocess the array, there's always the calculator filter.
David
More information about the vtk-developers
mailing list