[vtkusers] Using scalar to colour tensor glyphs
Faye LAWRENCE
F.Lawrence at cs.ucl.ac.uk
Fri Aug 4 06:07:11 EDT 2000
I have a structured points dataset with both scalar and tensor data (set to
the points of the dataset).
The aim of my program is to place at each point a tensorglyph, coloured with
the scalar data.
It is the colour which is the problem....
The scalar data is all in the RGB form with three components, I'm expecting
the glyphs to be all black, except for six towards the centre which should be
different shades of purple.
But they are red, blue and black, all through the dataset, the colour is not
even towards the centre. There does seem to be some pattern as whatever I do
to the scalar data, the black glyphs are always black, even when I set the
SetColorGlphs to false. Please see code below....
I have used the same list of scalars before to produce an image again using
structured points, so I don't understand why there is a difference. In fact
the code is almost exactly the same except that previously there were no
Tensors and the scalar data was set to the cells of the dataset.
I don't know whether it is relevant but I am using Java.
If anyone could shed some light on this I would be really grateful. It has
been plaguing me for four day now and I have made no progress.
Thanks Faye.
CODE:
scalars and tensors are created previously...
spts.GetPointData().SetScalars(scalars); spts.GetPointData().SetTensors(ten
sors);
vtkTensorGlyph ellip = new vtkTensorGlyph();
ellip.SetInput(spts);
ellip.SetSource(sphere.GetOutput());
ellip.SetScaleFactor(0.01);
More information about the vtkusers
mailing list