[vtkusers] How to color objects with RGB/HSV information?

Immo Trinks trinks at esc.cam.ac.uk
Fri Jun 18 12:05:41 EDT 2004


Thank you very much Julien. 
Yes, this example data works with ParaView.
I am just not seeing how to achieve the same result with a script.
I use the Tcl script below and wonder what I am missing.
Any suggestions?
Immo


vtkPolyDataReader reader
reader SetFileName "data.vtk"
reader SetVectorsName "colour"

vtkSphereSource ball
ball SetRadius 0.1

vtkGlyph3D glyph
glyph SetInput [reader GetOutput]
glyph SetSource [ball GetOutput]

vtkPolyDataMapper mapper
mapper SetInput [glyph GetOutput]
mapper SetColorModeToDefault
mapper SetScalarModeToUsePointFieldData

vtkActor points
points SetMapper mapper




On Friday 18 Jun 2004 11:55, ALIZIER Julien AUSY wrote:
> Hi again,
>
> This file works in ParaView :
>
> <begin>
> # vtk DataFile Version 3.0
> ####
> ASCII
> DATASET POLYDATA
>
> POINTS 3 float
>  0.0  0.0  0.0
>  1.0  0.0  0.0
>  0.0  1.0  0.0
>
> POLYGONS 1 4
> 3 0 1 2
>
> POINT_DATA 3
> VECTORS colour unsigned_char
>  255  0  0
>  0  255  0
>  0    0 255
> <end>
>
> -- Julien
>
>
>
> -----Message d'origine-----
> De : Immo Trinks [mailto:trinks at esc.cam.ac.uk]
> Envoyé : jeudi 17 juin 2004 23:28
> À : vtkusers at public.kitware.com
> Objet : [vtkusers] How to color objects with RGB/HSV information?
>
>
> Dear vtkUsers and vtkDeveloppers
>
> Could you please help me with the following problem:
> I have a polydata set with xyz points and RGB vectors assigned to the
> points
>
> (see example below).
> How can I color the pixels using RGB or HSV information?
> Searching the archives and reading the book I haven't found any example
> explaining the assignment of three color values to an object via a lookup
> table.
> I know how to color objects with one scalar value for each object.
> But I do not understand how to assign color to objects using three RGB or
> HSV
> values.
> Is it correct to load the RGB information as vector or shall I use scalars?
> I could as well provide HSV values instead of RGB if this would make the
> process easier.
> Thank you very much for any help!
>
> Immo
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq> Follow this link to
> subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list