[vtkusers] Textures, Colours, SetScalars

Xianjin Yang Yang at AGIUSA.COM
Wed Mar 26 14:49:30 EST 2003


I am afraid that it may be inappropriate to set NumberOfComponents to 3 for a
scalar that is meant to be a 1D array. For a 3D scalar, only the first value in
each tuple is accessible for your use(??). You need to build a vtkLookupTable to
store float color values (r, g, b), and then use the vtkIntArray of scalars as
the index to vtkLookupTable. Check out the book "Visualization Toolkit" 3rd ed.
(ver. 4.2) page 151 for detail. HTH.

Yang

-----Original Message-----
From: Markus Louw [mailto:mlouw at unizar.es] 
Sent: Wednesday, March 26, 2003 12:30 PM
To: vtkusers at public.kitware.com
Subject: [vtkusers] Textures, Colours, SetScalars


Hello All

I am quite disappointed with vtk´s lack of texture methods.   It seems that none
of the objects can read in a simple BMP file and paint it onto
a PolyData set. 

So I wrote the BMP file reader, now I am trying to visualize my data
 (3D vertex points of faces, each face with a texture map), and I´m trying to 
convert the byte RGB values to floats [0,1], (so that I can set the scalar
values of the vetrices to the new float colour values), but it doesn´t work, 
the colours come out all funny.     I have set the SetNumberofComponents of the
FloatArray scalar set to 3, and have initialized it with the correct number of
tuples...

Thakns
Markus



More information about the vtkusers mailing list