vtkVolumeProperty shade on : light orientation issue when user matrix has been modified

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

vtkVolumeProperty shade on : light orientation issue when user matrix has been modified

Renaud Lebrun

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();                   

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,

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:

Light_issue.jpg (184K) Download Attachment