How to use vtkOpenGLRenderWindow::GetZbufferData to get z-depth value?

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

How to use vtkOpenGLRenderWindow::GetZbufferData to get z-depth value?

informan
This post has NOT been accepted by the mailing list yet.
Hi,

I want to get the zBuf by call vtkOpenGLRenderWindow::GetZbufferData, but all the buffer values I got are equal 1.

vtkRenderWindow* rw = render->GetRenderWindow();
int width = rw->GetSize()[0];
int height = rw->GetSize()[1];
float* zBuf = rw->GetZbufferData( 0, 0, width-1, height-1);

What's wrong with these codes?

Thanks.
Loading...