[vtkusers] Color Problems

Vidyadhar vidyadhar at lucidindia.com
Thu Jul 3 08:30:38 EDT 2008


On vtkPolyDataMapper try ScalarVisibilityOff() method. My guess is surface extraction is assigning cell scalars and mapper is by default in ScalarVisibilityOn mode.
Vidyadhar
  ----- Original Message ----- 
  From: ivan gm 
  To: vtkusers at vtk.org 
  Sent: Thursday, July 03, 2008 2:58 PM
  Subject: [vtkusers] Color Problems


  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.



------------------------------------------------------------------------------


  _______________________________________________
  This is the private VTK discussion list.
  Please keep messages on-topic. Check the 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/20080703/96123e02/attachment.htm>


More information about the vtkusers mailing list