[vtkusers] Color a surface

Gerrick Bivins Gerrick.Bivins at halliburton.com
Tue Feb 11 18:04:33 EST 2014


Hi Nens,

If you set a lookup table on a mapper it will map scalar data to colors for you.



I think instead of "// Generate the colors for each point based on the color map"

You just need to create a vtkDoubleArray of your z values (or which ever coordinate you are using for elevation).

Set this as the scalars of you point data and get rid of the "colors" array.



This example has per cell coloring but gives an idea:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColorCells



Gerrick





From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of williams Lima
Sent: Tuesday, February 11, 2014 5:22 AM
To: vtkusers at vtk.org
Subject: Re: [vtkusers] Color a surface

Hi Nens could you send a complete code, sufficient to reproduce your problem?
regards
Williams

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient.  Any review, use, distribution, or disclosure by others is strictly prohibited.  If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140211/c3dbf8f5/attachment.html>


More information about the vtkusers mailing list