<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Re: [vtkusers] diffuse lighting after scaling with negative values</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16705" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi Gerrick,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>But the solution is probably to </FONT><FONT
face=Arial size=2>switch off two sided lighting: vtkRenderer::<FONT
size=2>TwoSidedLightingOff().</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Manuel</FONT></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=gbivins@objectreservoir.com
href="mailto:gbivins@objectreservoir.com">Gerrick Bivins</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=manuelfeige@googlemail.com
href="mailto:manuelfeige@googlemail.com">Manuel Feige</A> ; <A
title=vtkusers@vtk.org href="mailto:vtkusers@vtk.org">VTK-users</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, September 03, 2008 9:11
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [vtkusers] diffuse lighting
after scaling with negative values</DIV>
<DIV><BR></DIV><FONT face="Calibri, Verdana, Helvetica, Arial"><SPAN
style="FONT-SIZE: 11pt"><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="mailto:manuelfeige@googlemail.com">manuelfeige@googlemail.com</A>>
wrote:<BR><BR></SPAN></FONT>
<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>
<HR align=center width="95%" SIZE=3>
</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></BODY></HTML>