[vtkusers] Problem coloring actor

Jothybasu Selvaraj jothybasu at gmail.com
Tue Oct 2 01:31:46 EDT 2018


Dear All,

I am using vtk7.1 in my project. I am trying to color the actor using the
below code, while it works for some colors other are rendered as white or
in something else. The same code used to work well in vtk6.

Does ambient, diffuse, etc... has any effect? I tried setting the color in
[0,1] and [0,255] format and no change in behavior.

Any suggestions?

 // Create plane actor

    vtkSmartPointer<vtkActor>cutROI=

            vtkSmartPointer<vtkActor>::New();

    //qDebug()<<R<<G<<B<<"RGB...";

    //unsigned char color1[3] = {255, 180, 255};

    cutROI->GetProperty()->SetColor(255.0,180,255.0);

    cutROI->SetMapper(cutterMapper);

    cutROI->GetProperty()->SetAmbient(1.0);

    cutROI->GetProperty()->SetDiffuse(0.5);

    cutROI->GetProperty()->SetSpecular(0.0);

    cutROI->GetProperty()->SetOpacity(0.95);

    cutROI->GetProperty()->EdgeVisibilityOff();

    //cutROI->GetProperty()->SetEdgeColor(R,G,B);

    cutROI->GetProperty()->SetLineWidth(1.5);

Thanks


Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20181002/1c97b684/attachment.html>


More information about the vtkusers mailing list