<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’s my bad!<BR>
Gerrick<BR>
<BR>
On 9/3/08 2:32 PM, "Manuel Feige" <<a href="manuelfeige@googlemail.com">manuelfeige@googlemail.com</a>> 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>
<BR>
<B>From:</B> Gerrick Bivins <<a href="mailto:gbivins@objectreservoir.com">mailto:gbivins@objectreservoir.com</a>> <BR>
<BR>
<B>To:</B> Manuel Feige <<a href="mailto:manuelfeige@googlemail.com">mailto:manuelfeige@googlemail.com</a>> ; VTK-users <<a href="mailto:vtkusers@vtk.org">mailto:vtkusers@vtk.org</a>> <BR>
<BR>
<B>Sent:</B> Wednesday, September 03, 2008 9:11 PM<BR>
<BR>
<B>Subject:</B> Re: [vtkusers] diffuse lighting after scaling with negative values<BR>
<BR>
<BR>
<BR>
<BR>
Hi Manuel,<BR>
You should just rotate your actor 180 degrees rather than using the scale. This would avoid these kinds of problems.<BR>
Gerrick<BR>
<BR>
<BR>
On 9/3/08 1:55 PM, "Manuel Feige" <<a href="manuelfeige@googlemail.com">manuelfeige@googlemail.com</a>> wrote:<BR>
<BR>
<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 application needs to mirror the actors with respect to the x-y-plane. I can 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 diffuse lighting does not work after this transformation (the ambient lighting does). In this example the cone appears gray instead of 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* cone = vtkConeSource::New();<BR>
vtkDataSetMapper* mapper = vtkDataSetMapper::New();<BR>
mapper->SetInput(cone->GetOutput());<BR>
</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><BR>
</FONT><FONT FACE="Arial">vtkActor* actor = vtkActor::New();<BR>
actor->SetMapper(mapper);<BR>
actor->GetProperty()->SetRepresentationToSurface();<BR>
actor->GetProperty()->SetColor(1.0, 1.0, 1.0);<BR>
actor->GetProperty()->SetAmbient(0.5);<BR>
actor->SetScale(1,1,-1);<BR>
</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><BR>
</FONT><FONT FACE="Arial">vtkRenderer* renderer = vtkRenderer::New();<BR>
renderer->AddActor(actor);<BR>
vtkRenderWindow* renWin = vtkRenderWindow::New();<BR>
renWin->AddRenderer(renderer);<BR>
vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::New();<BR>
iren->SetRenderWindow(renWin);<BR>
iren->Initialize();<BR>
iren->Start();</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"> <BR>
<BR>
</FONT><FONT FACE="Arial">//Delete...<BR>
}<BR>
</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><BR>
</FONT><FONT FACE="Arial">Any suggestions how I can get the diffuse lighting running?<BR>
</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><BR>
</FONT><FONT FACE="Arial">Thanks in advance<BR>
Manuel Feige<BR>
</FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><BR>
<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 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></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>