<DIV>Hello,</DIV>  <DIV>&nbsp;</DIV>  <DIV>Thanks for the reply. I greatly appreciate your effort.</DIV>  <DIV>&nbsp;</DIV>  <DIV>I am glad that someone replied. I have posted more than 10 questions on the same topic and no one really replied. I also left a message for the kitware people.</DIV>  <DIV>&nbsp;</DIV>  <DIV>There is a command called <STRONG>gluUnProject</STRONG> in opengl which seems to do this job. It&nbsp;converts from window coordinates to object coordinates. The z values of the window coordinates is my zbuffer value.</DIV>  <DIV>&nbsp;</DIV>  <DIV>I could not find anything similar in VTK. Can i use opengl commands amidst VTK code ?</DIV>  <DIV>&nbsp;</DIV>  <DIV>Has anyone done this before , if so it would be a great help if they can send me the example code.</DIV>  <DIV>&nbsp;</DIV>  <DIV>Here is an article, where they talk about the exact similar problem. I think they also found a solution, but i could not understand it.</DIV>  <DIV>&nbsp;</DIV>  <DIV><A
 href="http://groups.google.com/group/microsoft.public.win32.programmer.directx/browse_thread/thread/292cf5940f0aed18/a9bdb6071603e02c?lnk=st&amp;q=convert+world+coordinates+to+z-buffer+values&amp;rnum=9&amp;hl=en#a9bdb6071603e02c">http://groups.google.com/group/microsoft.public.win32.programmer.directx/browse_thread/thread/292cf5940f0aed18/a9bdb6071603e02c?lnk=st&amp;q=convert+world+coordinates+to+z-buffer+values&amp;rnum=9&amp;hl=en#a9bdb6071603e02c</A></DIV>  <DIV>&nbsp;</DIV>  <DIV>Thanks in adavnce.</DIV>  <DIV>&nbsp;</DIV>  <DIV>Bye,</DIV>  <DIV>&nbsp;</DIV>  <DIV>Deepak</DIV>  <DIV>&nbsp;</DIV>  <DIV><BR><B><I>Matt Valerio &lt;mattdvalerio@ieee.org&gt;</I></B> wrote:</DIV>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">  <META content="Microsoft Word 11 (filtered medium)" name=Generator>  <STYLE>  v\:* {behavior:url(#default#VML);}  o\:* {behavior:url(#default#VML);}  w\:* {behavior:url(#default#VML);}  .shape
 {behavior:url(#default#VML);}  </STYLE>    <STYLE>  <!--   /* Font Definitions */   @font-face   {font-family:Tahoma;   panose-1:2 11 6 4 3 5 4 4 2 4;}   /* Style Definitions */   p.MsoNormal, li.MsoNormal, div.MsoNormal   {margin:0in;   margin-bottom:.0001pt;   font-size:12.0pt;   font-family:"Times New Roman";}  a:link, span.MsoHyperlink   {color:blue;   text-decoration:underline;}  a:visited, span.MsoHyperlinkFollowed   {color:purple;   text-decoration:underline;}  p   {mso-margin-top-alt:auto;   margin-right:0in;   mso-margin-bottom-alt:auto;   margin-left:0in;   font-size:12.0pt;   font-family:"Times New Roman";}  span.EmailStyle19   {mso-style-type:personal-reply;   font-family:Arial;   color:navy;}  @page Section1   {size:8.5in 11.0in;   margin:1.0in 1.25in 1.0in 1.25in;}  div.Section1   {page:Section1;}  -->  </STYLE>    <DIV class=Section1>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I am no expert
 on Z-buffers, but it seems that your perception of what data is stored in a Z-buffer is different than what data actually is stored there.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">The value in the Z-buffer is a number used to figure out which objects should be drawn first.&nbsp; (z-axis points out of the computer screen)&nbsp; It’s not necessarily the z-coordinate of the volume you’re trying to look at.<o:p></o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy
 size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Also, the data stored in the buffer is nonlinear:<o:p></o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html<o:p></o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Here’s the z-buffer algorithm:<o:p></o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">http://www.siggraph.org/education/materials/HyperGraph/scanline/visibility/zbuffer.htm<o:p></o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy
 size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hope that helps,<o:p></o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Matt<o:p></o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></div>  <DIV>  <DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">  <HR tabIndex=-1 align=center width="100%" SIZE=2>  </SPAN></FONT></DIV>  <div class=MsoNormal><B><FONT face=Tahoma size=2><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt;
 FONT-FAMILY: Tahoma"> vtkusers-bounces+mattdvalerio=ieee.org@vtk.org [mailto:vtkusers-bounces+mattdvalerio=ieee.org@vtk.org] <B><SPAN style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Deepak Roy<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tuesday, December 20, 2005 3:39 PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> vtkusers@vtk.org<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> [vtkusers] How to convert from Z Buffer values to z values in worldcoordinates ?</SPAN></FONT><o:p></o:p></div></DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><o:p>&nbsp;</o:p></SPAN></FONT></div>  <DIV id=RTEContent>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">hello,<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times
 New Roman" size=3><SPAN style="FONT-SIZE: 12pt">This is a question for all the z-buffer experts.<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">How can i convert the z-buffer values of an offscreen render window back to the z-values in the world coordinate system.<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- I am using parallel projection by calling <o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div
 class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">vtkRenderer::GetActiveCamera()::ParallelProjectionOn().<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- Then I am setting the size of the view port by using vtkRenderWindow::SetSize.<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- I rendered one actor and extracted the z-buffer <o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV> 
 <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- Then i made the first actor invisible and rendered a second actor. Extracted the z-buffer again.<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- Now i compute the cumulative difference between the two z-buffers by subtracting the two z-buffers<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- I want to transform this difference to the world coordinates. How do i do it ?<!  /DIV> <o:p></o:p></SPAN></FONT></div>  <DIV>  <div class=MsoNormal><FONT face="Times
 New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><STRONG><B><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- I have no idea how to go about, in doing this backward projection transformation. </SPAN></FONT></B></STRONG><o:p></o:p></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- Please Help !!!! Urgent....<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">- thanks in advance.<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
 style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Regards,<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Deepak Roy<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE:
 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></div></DIV>  <div><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">__________________________________________________<BR>Do You Yahoo!?<BR>Tired of spam? Yahoo! Mail has the best spam protection around <BR>http://mail.yahoo.com <o:p></o:p></SPAN></FONT></div></DIV></DIV></BLOCKQUOTE>  <DIV><BR></DIV><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com