<DIV>Hello Clinton,</DIV> <DIV> </DIV> <DIV>Thank you very much for the reply. I really appreciate it....</DIV> <DIV> </DIV> <DIV>What do you mean when u mentioned "You'd also have to take samples to find the width & height in world coordiantes of a screen pixel." I suppose you are talking about the volume of each screen pixel. Could you please explain how to find this in more detail ?</DIV> <DIV> </DIV> <DIV>I have looked into the code of vtkSelectVisiblePoints. It consists of the forward transformation and what i want is an inverse of it probably. </DIV> <DIV> </DIV> <DIV>In vtkSelectVisiblePoints, given object coordinates of the geometry, for example one of the vertices of the geometry we are rendering. </DIV> <DIV> </DIV> <OL> <LI>It is first converted to view coordinates using vtkCamera::<FONT size=2>GetCompositePerspectiveTransformMatrix( 1 , 0 , 1 ).</FONT></LI> <LI>Then it is converted to display coordinates using
vtkRenderer::ViewToDisplay</LI> <LI>The z value of the Display Coordinate is the z-buffer value we get.</LI></OL> <div>Now i wrote code to do the exact reverse</div> <div> </div> <OL> <LI>I convert the Display coordinates to View coordinates using vtkRenderer::DisplayToView</LI> <LI>Then i convert the view coordinates to world or object coordinates using the inverse of the matrix obtained using vtkCamera::<FONT size=2>GetCompositePerspectiveTransformMatrix( 1 , 0 , 1 ).</FONT></LI> <LI>This will give me the object coordinates. I do this in each execution of the inner loop that computes the difference of the z-values.</LI></OL> <div>Is this z-difference my final volume estimate or do i have to do any more transformation using the volume of a screen pixel ???? </div> <div> </div> <div>Dont you think this difference is still not independent of the display viewport ? </div> <div> </div> <div>Because for a simple testcase, a hemisphere of radius 8
whose volume should be approx 1072 units -----------> the computed z-difference is 185493.18 units which is not the volume obviously ?</div> <div> </div> <div>What more transformation is needed ?</div> <div> </div> <div>Thanks in Advance.</div> <div> </div> <div>Regards,</div> <div> </div> <div>Deepak</div> <DIV> </DIV> <DIV> </DIV> <DIV><BR><BR><B><I>Clinton Stimpson <clinton@elemtech.com></I></B> wrote:</DIV> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>You can look at the code in vtkSelectVisiblePoints to see how to <BR>transform between z-buffer data to world coordinates.<BR>You'd also have to take samples to find the width & height in world <BR>coordiantes of a screen pixel.<BR><BR>To find the volume enclosed in a set of triangulated surfaces, one can <BR>walk each triangle and sum the volumes of imaginary tetrahedrons where <BR>each tetrahedron is composed of
three points of a triangle and the <BR>origin (0,0,0).<BR><BR>vtkRenderer::ParallelProjectionOn is all you need for orthographic <BR>projection.<BR><BR>Clint<BR><BR>>Date: Thu, 8 Dec 2005 08:55:41 -0800 (PST)<BR>>From: Deepak Roy <CDEEPAKROY@YAHOO.COM><BR>>Subject: [vtkusers] Problem Interpreting z-buffer data. -- how to<BR>> convert z-buffer values to quantitative measurements !!!!!!<BR>>To: vtkusers@vtk.org<BR>><BR>>hello,<BR>> <BR>> 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.<BR>> <BR>> 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.<BR>> <BR>> 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.<BR>> <BR>> How can i transform the z-buffer values to quantitative z-values of the geometry renderer ?<BR>> <BR>> I tried multiplying it with the inverse of the vrkCamera::GetViewTransformation matrix but it doesnt work.<BR>> <BR>> I also tried doing vtkCamera::ViewToWorld on the final difference but this still does not work.<BR>> <BR>> Can anyone tell me, how to transform the z-buffer difference to a quantitative estimate of the volume. <BR>> <BR>> Please Help !!!!!!!!<BR>> <BR>> Thanks in advance.<BR>> <BR>> Regards,<BR>> <BR>> Deepak <BR>> <BR>><BR><BR></BLOCKQUOTE> <DIV><BR></DIV><p>
        
                <hr size=1>Yahoo! Shopping<br>
Find Great Deals on Holiday Gifts at <a href="http://us.rd.yahoo.com/mail_us/footer/shopping/*http://shopping.yahoo.com/;_ylc=X3oDMTE2bzVzaHJtBF9TAzk1OTQ5NjM2BHNlYwNtYWlsdGFnBHNsawNob2xpZGF5LTA1
">Yahoo! Shopping</a>