[vtkusers] Color texture mapping

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Mon Jul 30 11:33:10 EDT 2001


If you use vtkScalars::SetNumberOfComponents(3);
Make sure they are 3 chars and not 3 floats. Chars are rendered as RGB, 
floats are assumed to be something else and the first component only is 
mapped through a default lookuptable or something like that.

JB

At 16:20 30/07/2001, Tim Hutton wrote:
>Hello!
>
>I would like to map an RGB image onto a VTK object, is this possible?
>
>I have created a vtkScalars object:
>
>vtkScalars *scalars = vtkScalars::New();
>scalars->SetNumberOfComponents(3);
>scalars->SetNumberOfScalars(X*Y);
>
>and filled it with the RGB values for my image, I would now like to use 
>this as input to a vtkTexture
>for mapping onto an object. When I try this I get only the first channel 
>(red) being used, through a
>rainbow lookup table.
>
>Any pointers are much appreciated!
>
>Thanks,
>
>Tim.
>
>
>---------------------------------------------------------------------------
>Tim Hutton,                        http://www.eastman.ucl.ac.uk/~dmi/MINORI
>Research Fellow & PhD student,                   T.Hutton at eastman.ucl.ac.uk
>MINORI Project, Biomedical Informatics Unit,     Tel: [+44] (0)20 7915 2344
>Eastman Dental Institute, UCL,                   Fax: [+44] (0)20 7915 2303
>256 Gray's Inn Road, London WC1X 8LD, UK      Mobile: [+44] (0)7748 678 832
>---------------------------------------------------------------------------
>This email represents the views of the sender alone and must not be 
>construed as representing the views of the Eastman Dental Institute. It 
>may contain confidential information and may be protected by law as a 
>legally privileged document and copyright work. Its content should not be 
>disclosed and it should not be given or copied to anyone other than the 
>person(s) named or referenced above. If you have received this email in 
>error, please contact the sender.
>
>
>_______________________________________________
>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://public.kitware.com/mailman/listinfo/vtkusers





More information about the vtkusers mailing list