[vtkusers] Get "vertex color array" from vtkPolyData

Gerrick Bivins Gerrick.Bivins at halliburton.com
Fri Dec 14 09:55:08 EST 2012


Hi all,
I'm trying to hook VTK up to a different rendering engine. I've made it so far as to setup and execute my pipeline and
using the vtkPolyData, create the geometry in the rendering engine.
My issue now is that I want add per vertex color and normal information to it.
If I use VTK to render, ie vtkActor, everything works as expected. However I don't see how to extract the
"color" array from the mapper or the polydata. Is this possible?

In a very old version of vtk, there was a way to get the colors assigned to vertex data as an array from the mapper.
Something like:
vtkActor actor =...;
vtkPolyDataMapper mapper = ...;
actor.SetMapper(mapper);
mapper.getInput().Update();
...
double opacity = actor.GetProperty().GetOpacity();
colorArray =  mapper.MapScalars(opacity);
...

There was also a vtkMapper::GetColors() method but that is gone as well.

Gerrick

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121214/91643d81/attachment.htm>


More information about the vtkusers mailing list