[vtkusers] how to make 3D color filter

Jinyoung Hwang hwangjinyoung at gmail.com
Thu Dec 24 09:26:31 EST 2009


Hi all,

I'm now trying to construct 3D model having different color corresponding to
the location.
Below URL is an example what I want to do.
http://www.mathworks.com/access/helpdesk_ja_JP/help/techdoc/ref/streamtube2.gif

In the beginning, I construct color table using vtkLookupTable.
But it didn't work properly.

------------------------------------------------------------------------------------------------------------------------
 vtkSmartPointer<vtkLookupTable> lut =
vtkSmartPointer<vtkLookupTable>::New();
 lut->SetHueRange(0.0, 0.667);
 lut->SetSaturationRange(0, 0);
 lut->SetValueRange(0.2, 1.0);
 lut->Build();

 vtkSmartPointer<vtkPolyDataMapper> mapper =
vtkSmartPointer<vtkPolyDataMapper>::New();
 mapper->SetInputConnection(normals->GetOutputPort());
 mapper->SetLookupTable(lut);
 mapper->SetScalarRange(0.197813, 0.710419); // this is an example of book
 mapper->ScalarVisibilityOn();
------------------------------------------------------------------------------------------------------------------------

Does someone can know how to do this?

Jinyoung
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091224/bb799d98/attachment.htm>


More information about the vtkusers mailing list