[vtkusers] Color Problems
ivan gm
ivan.gm.itk at gmail.com
Thu Jul 3 05:28:45 EDT 2008
Hello vtk users,
I'm representing a bone in 3D generated with the vtkContourFilter. The
following code shows a red bone and a white light illuminating it.My problem
is that I don't know how to configure the actor properties for getting a
grey bone iluminated by a white light.
vtkContourFilter *contourFilter = vtkContourFilter::New();
vtkSmoothPolyDataFilter *smoothFilter =
vtkSmoothPolyDataFilter::New();
vtkPolyDataNormals *polyDataNormals = vtkPolyDataNormals::New();
contourFilter->SetInput(islandRemoval->GetOutput());
contourFilter->Update();
smoothFilter->SetInputConnection(contourFilter->GetOutputPort());
smoothFilter->SetNumberOfIterations(30);
smoothFilter->SetRelaxationFactor(1.0);
smoothFilter->Update();
polyDataNormals->SetInputConnection(smoothFilter->GetOutputPort());
polyDataNormals->Update();
this->BoneMapper->SetInput(this->polyDataNormals->getOutput());
this->BoneMapper->ImmediateModeRenderingOn();
this->BoneMapper->Update();
this->BoneActor->SetMapper(this->BoneMapper);
this->BoneActor->GetProperty()->SetColor(1.0, 1.0, 1.0);
this->BoneActor->GetProperty()->SetAmbientColor(1.0, 1.0, 1.0);
this->BoneActor->GetProperty()->SetSpecularColor(1.0, 1.0, 1.0);
this->BoneActor->GetProperty()->SetDiffuse(0.0);
this->BoneActor->GetProperty()->SetSpecular(10.0);
this->BoneActor->GetProperty()->SetSpecularPower(5);
Can anybody helps me?
Thanks a lot.
Iván García Martínez - Spain.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080703/30124444/attachment.htm>
More information about the vtkusers
mailing list