[vtkusers] Color mapping 3d points cloud

David Doria daviddoria at gmail.com
Fri Mar 30 07:31:39 EDT 2012


On Fri, Mar 30, 2012 at 4:25 AM, adrian C A <adrianca88 at hotmail.com> wrote:
> Hi,
>
> I have a cloud of 3d points that I read from file (each line stores de x y z
> coordinates) and save in a vtkPolyData using a vtkPoints. Next, using
> vtkDelaunay3d I achive to get the 3D rendering.
> My problem is that I want to create a colorMapping that represents different
> heigh with different colour, but I don't know how set this scalar value
> (which, in this case, depends on the z variable).
>
> Sorry if the question is very easy to solve but I am very newbie with VTK.
>
> A lot of thanks,
>
> Adrian.


There are two ways to do this:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/Color_a_mesh_by_height
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/ElevationFilter

or an even more manual way:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColoredPoints

David



More information about the vtkusers mailing list