Clipping incorrect in vtkGPUVolumeRayCastMapper VTK 7.0
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
The normals of clipping planes are handled incorrectly in
vtkVolumeShaderComposer.h:1545
std::string ClippingInit(vtkRenderer* vtkNotUsed(ren), vtkVolumeMapper* mapper, vtkVolume* vtkNotUsed(vol))
The result is that clipping planes which are not axis parallel are applied incorrectly (slightly rotated around their origin) to the volume.
The method transforms clipping planes from world coordinates to texture coordinates. The normals are simply multiplied with the transformation matrix for points. This is incorrect, since affine transformations change angles, but the normal should stay normal on the plane.
A correct way to perform the transformation would be to pick 3 points in the plane, transform them and then recompute the normal. I am sure one can also figure out directly a correct transformation matrix. In case of scaling only it is the inverse of the matrix for points.