<DIV id=RTEContent>hello,</DIV> <DIV> </DIV> <DIV>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.</DIV> <DIV> </DIV> <DIV>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.</DIV> <DIV> </DIV> <DIV>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::<FONT size=2>ComputePerspectiveTransform.</FONT></DIV> <DIV> </DIV> <DIV>How can i transform the z-buffer values to quantitative z-values of the geometry renderer ?</DIV> <DIV> </DIV> <DIV>I tried
multiplying it with the inverse of the vrkCamera::GetViewTransformation matrix but it doesnt work.</DIV> <DIV> </DIV> <DIV>I also tried doing vtkCamera::ViewToWorld on the final difference but this still does not work.</DIV> <DIV> </DIV> <DIV>Can anyone tell me, how to transform the z-buffer difference to a quantitative estimate of the volume. </DIV> <DIV> </DIV> <DIV>Please Help !!!!!!!!</DIV> <DIV> </DIV> <DIV>Thanks in advance.</DIV> <DIV> </DIV> <DIV>Regards,</DIV> <DIV> </DIV> <DIV>Deepak</DIV> <DIV> </DIV> <DIV> </DIV> <DIV> </DIV> <DIV>**************************************************************************************************</DIV> <DIV> </DIV> <DIV>Here is the loop that computes the z-difference:</DIV> <DIV> </DIV> <DIV><FONT color=#0000ff size=2> <div>double</FONT><FONT size=2> dblSphereVolume = 0.0;</FONT></div> <div><FONT size=2> </div> <div></FONT><FONT color=#0000ff
size=2>for</FONT><FONT size=2>( </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> i = 0 ; i < wx ; i++ )</div> <div>{</div> <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"> <div></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2>( </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> j = 0 ; j < wy ; j++ )</div> <div>{</div> <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"> <div></FONT><FONT color=#0000ff size=2>long</FONT><FONT size=2> index = i * j;</div> <div></FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2> coons_depth, sphere_depth;</FONT></div> <div><FONT size=2> </div> <div></div> <div></FONT><FONT color=#008000 size=2>// get hemi-sphere z</div></FONT><FONT size=2> <div>sphere_depth = pSphereZBuffer[index];</div> <div> </div> <div></div> <div></FONT><FONT color=#008000 size=2>// get z of the base plane of the hemisphere</FONT></div> <div> </div> <div><FONT size=2>coons_depth = pCoonsZBuffer[index];</div> <div></div>
<div></FONT><FONT color=#0000ff size=2></FONT> </div> <div><FONT color=#0000ff size=2>double</FONT><FONT size=2> diff = ( coons_depth - sphere_depth );</div> <div>dblSphereVolume += diff;</div></BLOCKQUOTE> <div>}</div></BLOCKQUOTE> <div>}</div> <div> </div> <div>printf( "\ncomputed Sphere volume = %f\n" , dblSphereVolume );</div></FONT></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>