[vtkusers] re:InterpolateScalarsBeforeMapping problem
Yixun Liu
yxliu at fudan.edu.cn
Tue Sep 5 02:29:15 EDT 2006
Hi,
1. Firstly change you surface mesh,if not vtkDataSet, to vtkPolyData named as surface.
2. vtkDoubleArray *scalars = vtkDoubleArray::New(); Assign the deformation magnitude at each node in the surface mesh to this scalars.
3. surface->GetPointData()->SetScalars(scalars);
4.create the lookup table
vtkLookupTable *satLut = vtkLookupTable::New();
satLut->SetTableRange (0, 256);
satLut->SetHueRange (.0, .0);
satLut->SetSaturationRange (1, 1);
satLut->SetValueRange (0.3, 1);
satLut->Build();
5.mapper
map->SetLookupTable(satLut);
map->SetColorModeToMapScalars();
map->SetScalarModeToUsePointData();
map->SetScalarRange(profile->GetScalarRange());
6.actor
vtkActor *act = vtkActor::New();
act->SetMapper(map);
Hope it help.
Yixun Liu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060905/1ca8a740/attachment.htm>
More information about the vtkusers
mailing list