[vtkusers] How to get color of pixel(or position) on colored polydata

Cory Quammen cory.quammen at kitware.com
Tue Apr 25 22:19:06 EDT 2017


That sounds fairly complicated to get the color. Do you just want the
color of the pixel at the location in the image? If so, you should be
able to use vtkRenderWindow::GetPixelData():

http://www.vtk.org/doc/nightly/html/classvtkWindow.html#afe513c0f9e8eaaf76d924cc9ce99182b

On Tue, Apr 25, 2017 at 9:18 PM, Tharun <tharun160190 at gmail.com> wrote:
> Thank you for the heads up.
>
> I do know how to pick a position. But, i want to know the value of color at
> a particular position. My actor consists of triangles and I can find
> triangle picked. My current workflow is
>
> 1) Find triangle picked
> 2) Find Barycentric coordinates of position picked in the triangle.
> 3) Interpolate color of position from the colors of vertices of triangle
> using Barycentric coordinates.
>
> But, the color calculate is wrong at times.
>
> I found that, in the actor I created, color inside triangle is interpolated
> per pixel basis. But, I have no idea how is that done.
>
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-color-of-pixel-or-position-on-colored-polydata-tp5742972p5742982.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.


More information about the vtkusers mailing list