[vtkusers] Coloring of Iso-Surfaces (vtkContourFilter)

Sebastian Gatzka sebastian.gatzka at stud.tu-darmstadt.de
Mon Mar 15 05:55:13 EDT 2010


Hello world.

After I have finally found a way of making the vtkContourFilter work I'm 
now facing how to color them.
I want to color them according to the value they are having.
Example: The cutting plane displays the "right" color for the scalar 
data, but the iso-surfaces (contours) are colored identically.
Have a look at the screenshot in the attachment.

So, what do I have to do, to set up the right coloring?

Here is the code I am using to create the contours:

vtkContourFilter *scalarIsoSurface = vtkContourFilter::New();
scalarIsoSurface->SetInput(sGridPointData->GetOutput());
scalarIsoSurface->SetValue(0,3);
scalarIsoSurface->SetValue(1,5);
scalarIsoSurface->Update();

vtkPolyDataNormals *sGridPolyDataNormal = vtkPolyDataNormals::New();
sGridPolyDataNormal->SetInput(scalarIsoSurface->GetOutput());
sGridPolyDataNormal->Update();

vtkPolyDataMapper *scalarIsoSurfaceMapper = vtkPolyDataMapper::New();
scalarIsoSurfaceMapper->SetInput(sGridPolyDataNormal->GetOutput());
scalarIsoSurfaceMapper->Update();

vtkActor *scalarIsoSurfaceActor = vtkActor::New();
scalarIsoSurfaceActor->SetMapper(scalarIsoSurfaceMapper);

Have a nice day.
Sebastian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100315/da1ef81d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iso.png
Type: image/png
Size: 25044 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100315/da1ef81d/attachment.png>


More information about the vtkusers mailing list