[vtkusers] Gradient along line through polydata file

sergio campos camposs968 at gmail.com
Mon Nov 28 17:33:44 EST 2011


hello

I have the next file:

# vtk DataFile Version 3.0
vtk output
ASCII
DATASET POLYDATA
POINTS 2 float
0 0 0
9 0 0
LINES 1 3
2 0 1
CELL_DATA 1
scalars cellvar float
LOOKUP_TABLE default
0.0
POINT_DATA 2
scalars pointvar float
LOOKUP_TABLE default
-1.0 1.0

which draw a line with the next lookUptable:

vtkSmartPointer<vtkColorTransferFunction> lut =
vtkSmartPointer<vtkColorTransferFunction>::New();
    lut->AddRGBPoint(-1,1,0,0); //red
    lut->AddRGBPoint(0,0,1,0); //green
    lut->AddRGBPoint(1,0,0,1);// blue

the program draws a line from point 0 with scalar -1.0(color red)  to the
point 1 with scalar 1.0(color blue), it's describes a gradient between this
two colors, but how to get gradients take into account the color green? I
mean if the color green is 0 , how can I get that? without add another
point in the middle of the line with scalar 0?

|------------------------------------------------------------------------------------|
red
green                                          blue
-1
0                                              1

regards

ruben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111128/7e6b7fea/attachment.htm>


More information about the vtkusers mailing list