[vtkusers] Can't modify the color of the actor even with 'SetColor' fucntion

Dominik Szczerba dominik at itis.ethz.ch
Wed Nov 19 14:39:56 EST 2008


mapper->Update();
actor->Modified();

Nour Mestiri wrote:
> Thank you Amy for your help.
> I tried this code line but that doesn't work: the polydata is not 'blue' 
> but it stills with its original color (no modification was applied)
> 
> --- En date de : *Mer 19.11.08, Amy Squillacote /<ahs at cfdrc.com>/* a écrit :
> 
>     De: Amy Squillacote <ahs at cfdrc.com>
>     Objet: Re: [vtkusers] Can't modify the color of the actor even with
>     'SetColor' fucntion
>     À: nourmestiri at yahoo.fr
>     Cc: "vtk" <vtkusers at vtk.org>
>     Date: Mercredi 19 Novembre 2008, 19h22
> 
>     Try calling mapper->ScalarVisibilityOff();
> 
>     - Amy
> 
>     Nour Mestiri wrote:
>     > Hi all vtk users,
>     > Can someone tell me how to modify the color of a polydata?
>     > In fact, i have a polydata (a VRML object) which i should display on a
>     window. When i read this file, the object is grey but i want to change its color
>     on white.
>     >  I use this the code below but i have a 'blue' object for each
>     value of 'SetColor()':
>     > vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();
>     > mapper->SetInput(myPolydata);
>     > vtkActor *actor = vtkActor::New();
>     > actor->SetMapper(mapper);
>     > actor->GetProperty()->SetColor(1,1,1);
>     >  Is there something to modify in this code or the code source of the VRML
>     file?
>     > Thank you for your help.
>     >   
>     > 
>     > ------------------------------------------------------------------------
>     > 
>     > _______________________________________________
>     > This is the private VTK discussion list.
>     > Please keep messages on-topic. Check the FAQ at:
>     http://www.vtk.org/Wiki/VTK_FAQ
>     > Follow this link to subscribe/unsubscribe:
>     > http://www.vtk.org/mailman/listinfo/vtkusers
>     >   
> 
>     -- Amy Squillacote                    Phone: (256) 726-4839
>     Computer Scientist                 Fax: (256) 726-4806
>     CFD Research Corporation           Web: http://www.cfdrc.com
>     215 Wynn Drive, Suite 501
>     Huntsville, AL  35805
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

-- 
Dominik Szczerba, PhD
Computational Physics Group
IT'IS Foundation
http://www.itis.ethz.ch



More information about the vtkusers mailing list