[vtkusers] Problem Interpreting z-buffer data. -- how to convert z-buffer values to quantitative measurements !!!!!!

Clinton Stimpson clinton at elemtech.com
Thu Dec 8 14:12:32 EST 2005


You can look at the code in vtkSelectVisiblePoints to see how to 
transform between z-buffer data to world coordinates.
You'd also have to take samples to find the width & height in world 
coordiantes of a screen pixel.

To find the volume enclosed in a set of triangulated surfaces, one can 
walk each triangle and sum the volumes of imaginary tetrahedrons where 
each tetrahedron is composed of three points of a triangle and the 
origin (0,0,0).

vtkRenderer::ParallelProjectionOn is all you need for orthographic 
projection.

Clint

>Date: Thu, 8 Dec 2005 08:55:41 -0800 (PST)
>From: Deepak Roy <cdeepakroy at yahoo.com>
>Subject: [vtkusers] Problem Interpreting z-buffer data. -- how to
>	convert	z-buffer values to quantitative measurements !!!!!!
>To: vtkusers at vtk.org
>
>hello,
>   
>  I am trying to compute the volume enclosed between two surface by subtracting the z-buffers of the two surfaces. I am using parallel projection for the computation.
>   
>  I computed the z-buffer difference, This difference is relative to the viewport size set up. I have no idea how to convert this difference to a quantitative estimate of the voume. I have problems interpreting the z-buffer data.
>   
>  Firslty, how to set the orthographic projection in VTK ? i call vtkRenderer::ParallelProjectionOn and then invoke vtkRenderer::ResetCamera. Is this enough ? or is anything wrong.  Because when i looked through the VTK code, i found glOrtho in vtkCamera::ComputePerspectiveTransform.
>   
>  How can i transform the z-buffer values to quantitative z-values of the geometry renderer ?
>   
>  I tried multiplying it with the inverse of the vrkCamera::GetViewTransformation matrix but it doesnt work.
>   
>  I also tried doing vtkCamera::ViewToWorld on the final difference but this still does not work.
>   
>  Can anyone tell me, how to transform the z-buffer difference to a quantitative estimate of the volume. 
>   
>  Please Help !!!!!!!!
>   
>  Thanks in advance.
>   
>  Regards,
>   
>  Deepak   
>  
>




More information about the vtkusers mailing list