How to obtain the depth map of a scene in VTK?

Hello @Lincac

You can easily get the Z buffer data like this:

vtkNew<vtkFloatArray> depthValues;
int* size = window->GetSize();
window->GetZBufferData(0, size[0] - 1, 0, size[1] - 1, depthValues);