[vtkusers] coloring a sphere by elevation

Liam Kurmos quantum.leaf at gmail.com
Fri Aug 19 10:46:33 EDT 2011


>
> Did you see this example?
>
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/Color_a_mesh_by_height
>

no missed that somehow. Cheers!

i note this example does not use mapper->setLookuptable() but rather
gets 'colors' from the LUT
and does

 outputPolyData->GetPointData()->SetScalars(colors);
 mapper->SetInputConnection(outputPolyData->GetProducerPort());

it looks like my lookup table was working but other that the
sethuerange() (which worked) it was having no effect on the output
when i did mapper->setLookuptable() . In fact i could remove my lut
and the mapper->setlookuptable() and get the same output with red to
blue hue range.

all working now, thanks for the help.

Liam


On Fri, Aug 19, 2011 at 2:48 PM, David Doria <daviddoria at gmail.com> wrote:
> On Fri, Aug 19, 2011 at 9:39 AM, Liam Kurmos <quantum.leaf at gmail.com> wrote:
>>
>> I'm creating an example to colour the surface of a sphere using a
>> lookup table, where the scalar value is just the value of one of the
>> vertex coords.
>> The code below essentially works but only shows 2 colors.
>>
>> 2Qs:
>>
>> -why dont i see a range of colors from the lookup table?
>>
>> -i thought i should be able to get the coordinates of a vertex from
>> the vtkPointData but i couldnt do this or find an example and had to
>> use vtkPolyData->getPoint(i). Is it straight forward to get down to
>> the points for pointdata?
>>
>>
>> any thoughts appreciated,
>>
>>
>> Liam
>
> Did you see this example?
>
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/Color_a_mesh_by_height
>
> David



More information about the vtkusers mailing list