[vtkusers] Scaling and colouring glyphs with different scalararrays

John Platt jcplatt at lineone.net
Sun Apr 3 18:59:28 EDT 2005


Hi Paul,

I haven't tried to use the LUT to select a component for colouring as an
alternative to ColorByArrayComponent(). If it can be done it would be
useful to know how.

Have you looked at vtkMergeFields for manipulating your point data?

HTH

John.

-----Original Message-----
From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On
Behalf Of Paul Cochrane
Sent: 01 April 2005 02:37
To: John Platt
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] Scaling and colouring glyphs with different
scalararrays

John,

Many thanks for your help!  I managed to get the spheres coloured the
way I
want them, however, it doesn't seem that elegant (code attached).  I
notice
that ColorByArrayComponent() is a legacy method, and that a lookup table
is
better.  How does one do this?  

Also, a related, but different question: if one has a vtk file
containing an
UnstructuredGrid with several arrays of PointData (each named), and then
tries to scale spherical glpyhs with one of the PointData arrays, and
colour
with one of the others, how can one do this elegantly?  What I'm doing
atm
is to extract the data from the unstructured grid, create a
vtkFloatArray
with two components (say) and then add the relevant data to the
FloatArray,
add this multicomponent array to the grid, and then use
ColorByArrayComponent() later down the track to colour by the second
component of the new data array.  This technique feels a bit hacky, and
seems to be a waste of memory, cpu, and time, so I was wondering if
there
was a better way to do this?

TIA

Paul

-- 
Paul Cochrane
Computational Scientist/Software Developer
Earth Systems Science Computational Centre
Rm 703, SMI Building
University of Queensland
Brisbane
Queensland 4072
Australia

E: cochrane at esscc.uq.edu.au
P: +61 7 3346 4109
F: +61 7 3365 7347





More information about the vtkusers mailing list