<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi Ken</p>
<p><br>
</p>
<p>My issue is the following: I have an OpenGl Actor, created like this:</p>
<p><br>
</p>
<p></p>
<div>            var mapper = vtkPolyDataMapper.New();</div>
<div>            mapper.SetInput(polyData);</div>
<div>            mapper.ImmediateModeRenderingOn();</div>
<div><br>
</div>
<div></div>
<div>            var actor = vtkActor.New();</div>
<div>            actor.SetProperty(vtkProperty.New());</div>
<div>            actor.GetProperty().SetColor(0.5, 0.5, 0.5);</div>
<div>            actor.GetProperty().SetInterpolationToFlat();</div>
<div>
<div>            actor.GetProperty().SetAmbient(0.45);</div>
<div>            actor.GetProperty().SetDiffuse(0.55);</div>
<br>
</div>
<br>
<p></p>
<p>At this point, the model looks like this:</p>
<p><br>
</p>
<p><img size="17654" contenttype="image/png" id="img227839" sizeoption="small" contextid="img367845" tabindex="0" style="" height="180" width="165" src="cid:d9f17763-1db4-4acb-8505-51aa685ba65c"><br>
</p>
<p><br>
</p>
<p>Then scalars get added:</p>
<p><br>
</p>
<span>    </span><span>    <span>    </span></span>polyData.GetPointData().AddArray(data);</div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<span>    </span><span>    <span>    </span>polyData.GetPointData().SetActiveScalars("name");</span></div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<span></span><span>
<div>            actor.GetMapper().SetScalarMode(1); // this is <span style="color: rgb(128, 96, 32); font-family: monospace, fixed; font-size: 13px; text-indent: -53px; white-space: pre-wrap; background-color: rgb(251, 252, 253);">VTK_SCALAR_MODE_USE_POINT_DATA</span></div>
<div>            actor.GetMapper().SetInterpolateScalarsBeforeMapping(1);</div>
<div><span>    </span><span>    </span><span>    </span>actor.GetMapper().SetScalarVisibility(1);<br>
</div>
</span><span></span>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<br>
</div>
Then it looks like this (which is fine):</div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<br>
</div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<img size="59898" contenttype="image/png" id="img207348" sizeoption="small" contextid="img39512" tabindex="0" style="" height="180" width="153" src="cid:b5c1ab6c-6c84-40df-8cb2-cfbf056fd6f0"><br>
<br>
To disable the scalars again, we do the following:</div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<br>
</div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<span>    </span><span>    <span>    </span></span>actor.GetMapper().SetScalarVisibility(0);</div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<br>
</div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
But now, the orignial color is rendered brighter, like this:</div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<br>
</div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<img size="14515" contenttype="image/png" id="img606863" sizeoption="small" contextid="img585887" tabindex="0" style="" height="180" width="153" src="cid:585b5372-dfe7-48fa-ac12-f38bbab10bea"></div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<br>
</div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
So my question is, how can I get back to the original state (with the darker grey)? I'm stuck using VTK 5.8 since we use the free Kitware <span>ActiViz C# wrapper. After some googling I suspected that my problem is related to the thread I answered to, but any
 help is appreciated.</span></div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<br>
</div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<span></span>I tried messing with the scalars material mode, resetting the scalars using 'polyData.GetPointData().GetScalars().Reset();' and resetting the diffuse lighting to 0.55. None of which helped. The current workaround is to have separate PolyDataMappers,
 one with the original state, and another where scalars are never set to active. And instead of showing and hiding scalars, we swap the mapper. But this seems like a hack...</div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<br>
</div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
Best regards,</div>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
Frederik<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Ken Martin <ken.martin@kitware.com><br>
<b>Gesendet:</b> Donnerstag, 13. Oktober 2016 17:22<br>
<b>An:</b> CARD Student<br>
<b>Cc:</b> vtk<br>
<b>Betreff:</b> Re: [vtkusers] Scalars and diffuse lighting</font>
<div> </div>
</div>
<div>
<div dir="ltr">I am not completely following your issue. But .. if you are using VTK with the OpenGL2 back end then the diffuse is based the actor's property when scalars are not visible. Note that colors and intensity in the actor's property cover a range
 of 0.0 to 1.0 not 0.0 to 255.0. If you can explain your problem a bit more specifically, including what version of VTK you are using and what rendering backend, the I might be able to help more.
<div><br>
</div>
<div>Thanks</div>
<div>Ken</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Oct 13, 2016 at 9:28 AM, Zivi, Der <span dir="ltr">
<<a href="mailto:cardstudent@balgrist.ch" target="_blank" title="mailto:cardstudent@balgrist.ch
Ctrl+Klicken oder tippen Sie, um dem Link zu folgen.">cardstudent@balgrist.ch</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
Hi David<br>
<br>
Sorry for digging out this ancient post, but I'm now having the same<br>
problem.<br>
<br>
More specifically, I don't mind that the diffuse coefficient is 1 when<br>
scalars are shown. But at some point the scalar visibility is reset to 0,<br>
but the diffues coefficient stays at 1. How can I switch back to using the<br>
diffuse coefficient set in the actor properties?<br>
<br>
Because the diffuse coefficient is only set to 1 once the active scalar is<br>
set, and there is no reset method...<br>
<br>
Frederik<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Scalars-and-diffuse-lighting-tp4298628p5740758.html" rel="noreferrer" target="_blank">
http://vtk.1045678.n5.nabble.<wbr>com/Scalars-and-diffuse-<wbr>lighting-tp4298628p5740758.<wbr>html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank" title="http://www.kitware.com/opensource/opensource.html
Ctrl+Klicken oder tippen Sie, um dem Link zu folgen.">
http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">
http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">
http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature">Ken Martin PhD
<div>Chairman & CFO<br>
Kitware Inc.<br>
28 Corporate Drive<br>
Clifton Park NY 12065<br>
518 371 3971
<div><br>
</div>
<div><span style="font-size:10pt; font-family:Tahoma,sans-serif">This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee.  Access to this email by anyone else
 is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the
 original message.  Thank you.</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>