Hi,
How are you getting the depth buffer image?
Since the code posted seems to be incomplete, you can use the vtkWindowToImageFilter
class (https://vtk.org/doc/nightly/html/classvtkWindowToImageFilter.html) to save z-buffer values as an image. Specifically, you need to call its SetInputBufferTypeToZBuffer()
to obtain an image like this:
In the case above, the brighter the closer a pixel is (you may use another convention).
Also, please, check whether the solution to this question: https://discourse.vtk.org/t/z-buffer-values-problem-with-camera/2224/2 works for you. Likewise, the user was getting a blank image.
regards,
PC