[vtkusers] vtkVolumeProperty shade on : light orientation issue when user matrix has been modified
Renaud Lebrun
renaud.lebrun at umontpellier.fr
Tue Apr 9 04:32:49 EDT 2019
Dear Vtk Users,
I have a question regarding volume mapper shading related with light
orientation.
I develop a VTK based application (
https://github.com/morphomuseum/MorphoDig ), in which I use 3D rendering
of a 3D volume with the vtkVolumeProperty shade option set to on.
I instantiated 1 (and only 1) light which I expect to follow the camera:
vtkSmartPointer<vtkLight> light = vtkSmartPointer<vtkLight>::New();
light->SetLightTypeToCameraLight();
this->getRenderer()->AddLight(light);
However, when I change the user matrix of the vtkVolume object, it seems
that the way the shading is computed is done *before* 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.
*
*
*See image attached : *
_Top line:_ 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.
_Bottom line:_ 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.
Or maybe there is something I do not get here?
Many thanks in advance for your answer,
Best regards,
Renaud
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20190409/2024b31e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Light_issue.jpg
Type: image/jpeg
Size: 137701 bytes
Desc: not available
URL: <https://vtk.org/pipermail/vtkusers/attachments/20190409/2024b31e/attachment-0001.jpg>
More information about the vtkusers
mailing list