[vtkusers] Coloring of Iso-Surfaces (vtkContourFilter)
Sebastian Gatzka
sebastian.gatzka at stud.tu-darmstadt.de
Mon Mar 15 07:14:40 EDT 2010
No, still blue ...
Am 15.03.2010 11:41, schrieb David E DeMarle:
> scalarIsoSurface->ComputeScalarsOn();
>
> On Mon, Mar 15, 2010 at 4:55 AM, Sebastian Gatzka
> <sebastian.gatzka at stud.tu-darmstadt.de> wrote:
>
>> 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
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100315/d51e0a17/attachment.htm>
More information about the vtkusers
mailing list