[vtkusers] color glyphs by vector

John Platt jcplatt at lineone.net
Fri Apr 22 04:08:03 EDT 2005


Hi Anders,

You could try post-processing the output scalars to create new scalars
of type vtkUnsignedCharArray with 3 components for RGB based on your
vectors (note that vtkTensorGlyph will not pass any input vectors). To
be honest though, it's probably easier to modify the filter.

There are some improvements in the pipeline for colouring tensor glyphs.
These include preserving the input scalar type (at present the output
scalars are double, single component so you cannot pass RGB components
through as vtkUnsignedCharArray to circumvent colour mapping). This may
help because you can pre-process your input to give the correct scalars.

HTH

John.

-----Original Message-----
From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On
Behalf Of Anders Vestbo
Sent: 21 April 2005 12:27
To: vtkusers at vtk.org
Subject: [vtkusers] color glyphs by vector

dear vtkusers,

i am using the vtkTensorGlyph class to display some tensors as 
ellipsoids in a tensor field. what i would like to do is to assign 
colors to each ellipsoid based on the direction of a vector, i.e. set 
the red, green and blue components of the color value to the x, y, and z

components of the vector. can anyone provide me with an hint (example 
code would be highly appreciated!) on how to do this?

Anders Vestbo
_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers





More information about the vtkusers mailing list