<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Dear Vtk Users,</p>
<p>I have a question regarding volume mapper shading related with
light orientation. <br>
</p>
<p>I develop a VTK based application ( <a moz-do-not-send="true"
href="https://github.com/morphomuseum/MorphoDig">https://github.com/morphomuseum/MorphoDig</a>
), in which I use 3D rendering of a 3D volume with the
vtkVolumeProperty shade option set to on. <br>
</p>
<p>I instantiated 1 (and only 1) light which I expect to follow the
camera: <br>
</p>
<div class="moz-signature">vtkSmartPointer<vtkLight> light =
vtkSmartPointer<vtkLight>::New(); <br>
light->SetLightTypeToCameraLight();<br>
this->getRenderer()->AddLight(light);</div>
<div class="moz-signature"><br>
</div>
<div class="moz-signature">However, when I change the user matrix of
the vtkVolume object, it seems that the way the shading is
computed is done <b>before</b> the user matrix of the volume is
used to move the 3D volume in space (see image attached). If I
understand things correctly, the user matrix of the volume should
be taken into account before the shading is achieved, but it seems
not to be the case.</div>
<div class="moz-signature"><b><br>
</b></div>
<div class="moz-signature"><b>See image attached : </b><br>
</div>
<div class="moz-signature"><u>Top line:</u> on the left, I have set
a camera "front" light, and the shading of the object appears as I
expect. On the left, I applied a 180° rotation of the object (the
camera) and it seems that the light comes from the back side,
which is unexpected. <br>
<u>Bottom line:</u> when rendering vtkPolyData objects, however,
the direction of a "camera" light works: the user matrix is
applied before the light direction and after being rotated 180°,
the light seems to come from the front side as well.</div>
<div class="moz-signature"><br>
</div>
<div class="moz-signature">Or maybe there is something I do not get
here?<br>
</div>
<div class="moz-signature"><br>
</div>
<div class="moz-signature">Many thanks in advance for your answer,<br>
Best regards, <br>
Renaud</div>
<br>
</body>
</html>