Apologies if this question has been asked/answered already.
I currently have a VTK mesh model upon which I’ve placed vector/arrow glyphs. I know I can apply a color map based on the magnitude of each vector, but is there a way I can either edit or create a color map such that the RGB color codes correspond to the values of all three of its components? For example, a vector that lies completely in the x-direction would have a RGB code of [1, 0, 0] and be colored as pure red, but another vector that lies in both the x and z-directions would have an RGB code of [1, 0, 1] and thus be colored purple.
I’m aware that a color map can be applied to a single component at a time and each component can be visualized individually as their own colored glyphs, but I’m looking for a way to visualize the resolved vectors in such a way that the color map takes all three components (x, y, z) into account to determine the color value.
While I don’t recommend coloring vector data in this way, ParaView does let you do it.
In your case, you would want to generate a 3-component double array that holds the RGB colors. Once you have that, turn off the Map Scalars array (which also turns off mapping vector arrays) and you’ll see the data colored by the raw RGB values you computed.
How do you compute RGB values? Maybe your data source already has the values scaled in the range [0, 1] for each component. If not, you can use a Calculator filter to compute a 3-component array with the RGB values.
To see this, open up ParaView. Add a Sphere source with default property values. This source has a 3-component array called “Normals”, and each component is in the range [-1, 1].
To rescale these components to [0,1], add a Calculator filter with the expression
In the Pipeline Browser, make sure the Calculator1 source is selected, In the Properties panel, deselect the Map Scalars property. You should get an image like this: