[vtkusers] Color an actor

Ashika Umanga Umagiliya aumanga at biggjapan.com
Thu Oct 7 02:44:08 EDT 2010


(sorry If I posted this twice).

Turn the scalar visibility off of the mapper objects.
(The color value set in actors property only takes effect when where is no
scalar data available to the actors mapper.)

tileMapper->ScalarVisibilityOff();

best regards.


On 7 October 2010 15:01, Gib Bogle <g.bogle at auckland.ac.nz> wrote:

> This must have a very simple answer.  I am creating a mapper (tileMapper)
> to render a polygon, using the same code as in the Wiki example polygon.cxx.
>  I expect to be able to set the color when I create an actor:
>
> double tileColor[] = {0.5, 0.5, 0.0};
> actor = vtkActor::New();
> actor->SetMapper(tileMapper);
> actor->GetProperty()->SetColor(tileColor);
>
> but it doesn't work.  The tile always displays with the color that was set
> when the PolyData used by tileMapper was created:
>
> polygonPolyData->GetCellData()->SetScalars(colors);
>
> The method I'm using (unsuccessfully) to set the color is the same I use
> with other mappers, created using vtkSphereSource, for example.
>
> How should I be doing it?
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101007/e6f8caab/attachment.htm>


More information about the vtkusers mailing list