Quantcast

Get "vertex color array" from vtkPolyData

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Get "vertex color array" from vtkPolyData

Gerrick Bivins

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

 


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get "vertex color array" from vtkPolyData

alanwsx
Hey, I found the solution. You can read by PCL::IO::ReadPLY and then convert it to VTK style.

It is really weird why they don't have this function itself in VTK.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get "vertex color array" from vtkPolyData

Cory Quammen-2
`vtkUnsignedCharArray* vtkMapper::GetColorMapColors()` looks like it
also gets you the vertex colors, though I haven't used it myself.

- Cory

On Fri, Apr 21, 2017 at 2:33 PM, alanwsx <[hidden email]> wrote:

> Hey, I found the solution. You can read by PCL::IO::ReadPLY and then convert
> it to VTK style.
>
> It is really weird why they don't have this function itself in VTK.
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Get-vertex-color-array-from-vtkPolyData-tp5717618p5742939.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers



--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Loading...