Rotating vectors around an axis

So, i have a vector field i need to display in vtk, i have x and y coordinates (it’s a vector field on a 0 z axis, just a plane) but i also have for every vector a rotation around an axis, so what i’m asking here is, is it possible to apply a transform array or something like that to rotate each vector individually? Or am i forced to create an actor for each vector to display it properly (doesn’t seem good for memory)

Thanks for your answer.

What is your rotation? Can you rotate all the vectors in the field so you just have an array of post rotated vectors?

The vtkGlyph3D filter should do the trick.

vtkNew<vtkArrowSource> glyphSource;
glyphSource->SetShaftRadius(0.03 * RadiusScale);
glyphSource->SetTipRadius(0.1 * RadiusScale);

vtkNew<vtkGlyph3D> glyphFilter;

Where myInputPoly provides all the positions of the vectors as well as a 3 component vtkDataArray that gives the vectors. ie: myInputPoly->GetPointData()->SetScalars();

It may also be sensitive to the name of the array, I can’t remember. In some old code of mine I have it force the name to “Scalars”.

glyphFilter->GetOutput() should then give you output poly data of a bunch of arrows copied to the positions of myInputPoly, and oriented by the vectors given by the active scalars.

Ok thank you i’ll try working around that!