<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Dear All,</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">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.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Does ambient, diffuse, etc... has any effect? I tried setting the color in [0,1] and [0,255] format and no change in behavior.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Any suggestions?</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Create</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">plane</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">actor</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">vtkSmartPointer</span><<span style="color:rgb(128,0,128)">vtkActor</span>><span style="color:rgb(9,46,100)">cutROI</span>=</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">vtkSmartPointer</span><<span style="color:rgb(128,0,128)">vtkActor</span>>::<span style="color:rgb(0,103,124)">New</span>();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//qDebug()<<R<<G<<B<<"RGB...";</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//unsigned</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">char</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">color1[3]</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">{255,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">180,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">255};</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">cutROI</span>-><span style="color:rgb(0,103,124)">GetProperty</span>()-><span style="font-style:italic;color:rgb(0,103,124)">SetColor</span>(<span style="color:rgb(0,0,128)">255.0</span>,<span style="color:rgb(0,0,128)">180</span>,<span style="color:rgb(0,0,128)">255.0</span>); </pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">cutROI</span>-><span style="font-style:italic;color:rgb(0,103,124)">SetMapper</span>(<span style="color:rgb(9,46,100)">cutterMapper</span>); </pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">cutROI</span>-><span style="color:rgb(0,103,124)">GetProperty</span>()-><span style="font-style:italic;color:rgb(0,103,124)">SetAmbient</span>(<span style="color:rgb(0,0,128)">1.0</span>);</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">cutROI</span>-><span style="color:rgb(0,103,124)">GetProperty</span>()-><span style="font-style:italic;color:rgb(0,103,124)">SetDiffuse</span>(<span style="color:rgb(0,0,128)">0.5</span>);</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">cutROI</span>-><span style="color:rgb(0,103,124)">GetProperty</span>()-><span style="font-style:italic;color:rgb(0,103,124)">SetSpecular</span>(<span style="color:rgb(0,0,128)">0.0</span>);</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">cutROI</span>-><span style="color:rgb(0,103,124)">GetProperty</span>()-><span style="font-style:italic;color:rgb(0,103,124)">SetOpacity</span>(<span style="color:rgb(0,0,128)">0.95</span>);</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">cutROI</span>-><span style="color:rgb(0,103,124)">GetProperty</span>()-><span style="font-style:italic;color:rgb(0,103,124)">EdgeVisibilityOff</span>();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//cutROI->GetProperty()->SetEdgeColor(R,G,B);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">cutROI</span>-><span style="color:rgb(0,103,124)">GetProperty</span>()-><span style="font-style:italic;color:rgb(0,103,124)">SetLineWidth</span>(<span style="color:rgb(0,0,128)">1.5</span>);</pre><pre style="margin-top:0px;margin-bottom:0px">Thanks </pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">Jothy</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span></pre></div></div>