[vtkusers] How to convert from Z Buffer values to z values in worldcoordinates ?

Deepak Roy cdeepakroy at yahoo.com
Wed Dec 21 11:48:01 EST 2005


Hello,
   
  Thanks for the reply. I greatly appreciate your effort.
   
  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.
   
  There is a command called gluUnProject in opengl which seems to do this job. It converts from window coordinates to object coordinates. The z values of the window coordinates is my zbuffer value.
   
  I could not find anything similar in VTK. Can i use opengl commands amidst VTK code ?
   
  Has anyone done this before , if so it would be a great help if they can send me the example code.
   
  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.
   
  http://groups.google.com/group/microsoft.public.win32.programmer.directx/browse_thread/thread/292cf5940f0aed18/a9bdb6071603e02c?lnk=st&q=convert+world+coordinates+to+z-buffer+values&rnum=9&hl=en#a9bdb6071603e02c
   
  Thanks in adavnce.
   
  Bye,
   
  Deepak
   
  
Matt Valerio <mattdvalerio at ieee.org> wrote:
        v\:* {behavior:url(#default#VML);}  o\:* {behavior:url(#default#VML);}  w\:* {behavior:url(#default#VML);}  .shape {behavior:url(#default#VML);}                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.
   
  The value in the Z-buffer is a number used to figure out which objects should be drawn first.  (z-axis points out of the computer screen)  It’s not necessarily the z-coordinate of the volume you’re trying to look at.
   
  Also, the data stored in the buffer is nonlinear:
  http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html
   
  Here’s the z-buffer algorithm:
  http://www.siggraph.org/education/materials/HyperGraph/scanline/visibility/zbuffer.htm
   
  Hope that helps,
  Matt
   
      
---------------------------------
  
  From: vtkusers-bounces+mattdvalerio=ieee.org at vtk.org [mailto:vtkusers-bounces+mattdvalerio=ieee.org at vtk.org] On Behalf Of Deepak Roy
Sent: Tuesday, December 20, 2005 3:39 PM
To: vtkusers at vtk.org
Subject: [vtkusers] How to convert from Z Buffer values to z values in worldcoordinates ?

   
    hello,

     

    This is a question for all the z-buffer experts.

     

    How can i convert the z-buffer values of an offscreen render window back to the z-values in the world coordinate system.

     

    - I am using parallel projection by calling 

     

    vtkRenderer::GetActiveCamera()::ParallelProjectionOn().

     

    - Then I am setting the size of the view port by using vtkRenderWindow::SetSize.

     

    - I rendered one actor and extracted the z-buffer 

     

    - Then i made the first actor invisible and rendered a second actor. Extracted the z-buffer again.

     

    - Now i compute the cumulative difference between the two z-buffers by subtracting the two z-buffers

     

    - I want to transform this difference to the world coordinates. How do i do it ? 
     

    - I have no idea how to go about, in doing this backward projection transformation. 

     

    - Please Help !!!! Urgent....

     

    - thanks in advance.

     

    Regards,

     

    Deepak Roy

     

     

     

     

     

  __________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


  


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20051221/564dc551/attachment.htm>


More information about the vtkusers mailing list