[vtkusers] scalar array

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Wed Oct 23 16:31:55 EDT 2002


>>>>> "SU" == Stefan Ulbrich <stevie157 at gmx.net> writes:

    SU> hello, how can I associate a scalar array with a polydata so
    SU> that I can use scalars to be mapped as colors?

p = vtkPolyData()

s = vtkFloatArray() # or whatever.
# setup your array correctly.

p.GetPointData().SetScalars(s)

For CellData just do GetCellData().SetScalars(s)

cheers,
prabhu



More information about the vtkusers mailing list