[vtkusers] Scaling and colouring glyphs with different scalararrays

Paul Cochrane cochrane at esscc.uq.edu.au
Mon Apr 4 00:36:24 EDT 2005


John,

> 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.
If I can get it to work, I'll either email you or post to the list.
> 
> Have you looked at vtkMergeFields for manipulating your point data?
I just had a look at it, but don't think it really buys me anything.  The
vtkGlyph3D object needs an UnstructuredGrid, so when I set up the
MergeFields object like so:

data = vtk.vtkMergeFields()
data.SetInput(grid)
data.SetOutputField("data", "POINT_DATA")  # I also tried DATA_OBJECT but no luck
data.SetNumberOfComponents(2)
data.Merge(0, "radii", 0)
data.Merge(1, "tags", 0)
data.Update()

and then call data.GetUnstructuredGridOutput(), I basically get back exactly
the grid that I put in.  It seems silly that I have several arrays in the
PointData section of the UnstructuredGrid object, each with names, but which
I can't specify one to use for sphere/glyph size, and one for colour.  I
know it can be done, but I sort of have to pick it apart first, and then put
duplicate data into the grid to make it work.  Seems messy somehow.

I shall keep plugging away, and see how I go.

Much thanks for your help though!

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