<HTML>
<HEAD>
<TITLE>Re: [vtkusers] diffuse lighting after scaling with negative values</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
Yup. That&#8217;s my bad!<BR>
Gerrick<BR>
<BR>
On 9/3/08 2:32 PM, &quot;Manuel Feige&quot; &lt;<a href="manuelfeige@googlemail.com">manuelfeige@googlemail.com</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><SPAN STYLE='font-size:11pt'><FONT FACE="Arial">Hi Gerrick,<BR>
</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"> <BR>
</FONT><FONT FACE="Arial">no, a 180 degrees rotation is not the same as the mirroring with respect to a plane. Moreover, you cannot accomplish mirroring by any combination of rotations. Take a book or something like that to convince yourself of this fact.<BR>
</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"> <BR>
</FONT><FONT FACE="Arial">But the solution is probably to switch off two sided lighting: vtkRenderer::TwoSidedLightingOff().<BR>
</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"> <BR>
</FONT><FONT FACE="Arial">Manuel<BR>
</FONT></SPAN><BLOCKQUOTE><SPAN STYLE='font-size:11pt'><FONT FACE="Calibri, Verdana, Helvetica, Arial"> <BR>
----- Original Message ----- <BR>
&nbsp;<BR>
<B>From:</B> &nbsp;Gerrick Bivins &lt;<a href="mailto:gbivins@objectreservoir.com">mailto:gbivins@objectreservoir.com</a>&gt; &nbsp;<BR>
&nbsp;<BR>
<B>To:</B> Manuel Feige &lt;<a href="mailto:manuelfeige@googlemail.com">mailto:manuelfeige@googlemail.com</a>&gt; &nbsp;; VTK-users &lt;<a href="mailto:vtkusers@vtk.org">mailto:vtkusers@vtk.org</a>&gt; &nbsp;<BR>
&nbsp;<BR>
<B>Sent:</B> Wednesday, September 03, 2008 9:11 &nbsp;PM<BR>
&nbsp;<BR>
<B>Subject:</B> Re: [vtkusers] diffuse lighting &nbsp;after scaling with negative values<BR>
&nbsp;<BR>
<BR>
<BR>
<BR>
Hi Manuel,<BR>
You should just rotate your &nbsp;actor 180 degrees rather than using the scale. &nbsp;This would avoid these &nbsp;kinds of problems.<BR>
Gerrick<BR>
<BR>
<BR>
On 9/3/08 1:55 PM, &quot;Manuel Feige&quot; &nbsp;&lt;<a href="manuelfeige@googlemail.com">manuelfeige@googlemail.com</a>&gt; &nbsp;wrote:<BR>
<BR>
&nbsp;<BR>
</FONT></SPAN><BLOCKQUOTE><SPAN STYLE='font-size:11pt'><FONT FACE="Arial">Hello,<BR>
</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><BR>
</FONT><FONT FACE="Arial">my &nbsp;application needs to mirror the actors with respect to the x-y-plane. I can &nbsp;do this by </FONT></SPAN><FONT SIZE="4"><FONT FACE="Times New Roman"><SPAN STYLE='font-size:14pt'>vtkProp3D::SetScale(1, 1, -1). Unfortunately the &nbsp;diffuse lighting does not work after this transformation (the ambient &nbsp;lighting does). In this example the cone appears gray instead of &nbsp;white.<BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><SPAN STYLE='font-size:11pt'><FONT FACE="Arial">int main()<BR>
{<BR>
vtkConeSource* &nbsp;cone = vtkConeSource::New();<BR>
vtkDataSetMapper* mapper = &nbsp;vtkDataSetMapper::New();<BR>
mapper-&gt;SetInput(cone-&gt;GetOutput());<BR>
</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><BR>
</FONT><FONT FACE="Arial">vtkActor* actor = &nbsp;vtkActor::New();<BR>
actor-&gt;SetMapper(mapper);<BR>
actor-&gt;GetProperty()-&gt;SetRepresentationToSurface();<BR>
actor-&gt;GetProperty()-&gt;SetColor(1.0, &nbsp;1.0, &nbsp;1.0);<BR>
actor-&gt;GetProperty()-&gt;SetAmbient(0.5);<BR>
actor-&gt;SetScale(1,1,-1);<BR>
</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><BR>
</FONT><FONT FACE="Arial">vtkRenderer* renderer = &nbsp;vtkRenderer::New();<BR>
renderer-&gt;AddActor(actor);<BR>
vtkRenderWindow* &nbsp;renWin = &nbsp;vtkRenderWindow::New();<BR>
renWin-&gt;AddRenderer(renderer);<BR>
vtkRenderWindowInteractor* &nbsp;iren = &nbsp;vtkRenderWindowInteractor::New();<BR>
iren-&gt;SetRenderWindow(renWin);<BR>
iren-&gt;Initialize();<BR>
iren-&gt;Start();</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"> <BR>
&nbsp;<BR>
</FONT><FONT FACE="Arial">//Delete...<BR>
}<BR>
</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><BR>
</FONT><FONT FACE="Arial">Any &nbsp;suggestions how I can get the diffuse lighting running?<BR>
</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><BR>
</FONT><FONT FACE="Arial">Thanks &nbsp;in advance<BR>
Manuel Feige<BR>
</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><BR>
&nbsp;<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"> </FONT></SPAN><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>_______________________________________________<BR>
This &nbsp;is the private VTK discussion list.<BR>
Please keep messages on-topic. Check &nbsp;the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><BR>
Follow &nbsp;this link to subscribe/unsubscribe:<BR>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><BR>
</SPAN></FONT></FONT></BLOCKQUOTE></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"></SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>_______________________________________________<BR>
This is the private VTK discussion list.<BR>
Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><BR>
Follow this link to subscribe/unsubscribe:<BR>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><BR>
</SPAN></FONT></FONT></BLOCKQUOTE>
</BODY>
</HTML>