Re: An unanswered zbuffer question in VTK..................Please Help !!!!!!!!
A million thanks for your reply. I greatly appreciate it.
Let us keep the discussion on the mailing list, so other members can benefit from it. Because this is a problem, that could quite possibly be faced by anyone who is working on the zbuffer.
>>>> Regarding the use of vtkWorldPointPicker
I tried the vtkWorldPointPicker and it was very slow ( render window size 500 x 500 ).
But what i interpret from the information given in the vtk textbook ( "The VisualizationToolkit - 2nd edition" An Object oriented approach to 3D graphics - Page Number = 343 ) is that vtkWorldPointPicker just finds the z-buffer value of the given ( x , y ) position in the render window.
Which i think is in no way different from the information obtained from vtkRenderWindow::GetZBufferData.
Please correct me if i am wrong ?
If all i get from the vtkWorldPointPicker is the z-buffer value, dont you think calling vtkWorldPointPicker at each ( x , y ) position in my offscreen render window would be slower than fetching the z-buffer values all at once by calling vtkRenderWindow::GetZBufferData.
Please correct me if i am wrong ?
>>>> Regarding the use of vtkCoordinate
The farthest place i can get using the vtkCoordinate, is to the world coordinates.
Which is the same as, what your vtkWorldPointPicker returns which is also similar to the zbuffer information obtained by vtkRenderWindow::GetZBufferData. Also when i tried using vtkCoordinate earlier it was very slow.
Now the difference between the two zbuffers i am computing ( to find the volume ) is relative to the current graphics world i created ( the clipping plane positions, dimensions of the viewport ). Rememeber i am using Orthographic
i.e. Parallel projection.
My goal is to transform this volume estimate ( which is now relative to the graphics world i created ) to be independent of the graphics world. So even if i change the size of the render window, the volume estimate should still be the same.
If you have not looked at the transformation, i am currently using, here is the pseudocode :
I recommend looking at the vtkWorldPointPicker and other pickers for how to do this. Also look at vtkCoordinate and vtkRenderer for coordinae transformations.
At 12:12 PM 1/12/2006, Deepak Roy wrote:
My name is Deepak Roy. I am a graduate student in the department of computer science at university of houston and a research assistant in the Computational Biomedicine Lab (
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.cbl.uh.edu/" target="_blank">www.cbl.uh.edu ) at university of houston.
I have sent numerous emails to the mailing list regarding a question in VTK, but recieved no reply. I have also sent an email before to you and recieved no reply either.
It would be kind of you if you could look into the question. Below is a brief description of it.
It would also be helpful, if you could give me a contact number of the VTK Tech support people.
Very Eagerly waiting for a reply, from the VTK Tech Support.
How to convert the z-buffer depth values to z-values in the world coordinate system ?
Problem I am trying to solve:
I am trying to get the volume enclosed between a hemisphere like surface and a plane like surface which lies at the base of the hemispherical surface.
These surfaces are extracted from the mesh of a human body.
I want to use the z-buffer difference to estimate the enclosed volume, since it is more quick compared to vtkMassProperties. At the end i will compare with vtkMassProperties estimate. I very well know this can be done with other alternatives, but i want to use the z-buffer difference only first to see how it works.
Approach i am following:
To simplify my problem, here are the steps i am following
I first created a simple hemisphere actor using vtkSphereSource
Next i create a simple square Plane actor which represents the base of the hemispherical surface.
Now i create an off screen render window using vtkWin32OpenGLRenderWindow.
I make the renderer to use OrthographicProjection using vtkRenderer::ParallelProjectionOn.
Then i first render both actors to the renderer.
I get the z-buffer data of the render window using vtkRenderWindow::GetZBufferData with the hemisphere and cache it.
Then i hide the hemipherical actor using vtkActor::VisibilityOff.
Then i get the z-buffer data of the plane actor.
Now i compute the cumulative difference between the two zbuffers which is an estimate of the volume.
I rendered the off screen render window for both actors to a disk image using vtkWindowToImageFilter and both the images come perfectly as expected. The images are attached to the message if you want to take a look.
Now the difficulty is this estimate of the volume is relative to the graphic world i created.
How do i convert it to an est! imate of the real volume ? which factor or scales should i multiply the z-buffer differnce with to get the volume ?
How do i back transform the ZBuffer values? I came to know there is something called gluUnProject in opengl GLUT. Is there anything similar in VTK.
Can i use opengl commands amidst VTK code ?
- the C++ test code i am using - zbuffer_test.cxx. You can run and test the C++ file if you want.
- the z-buffer image i obtained for the hemisphere - sphere-zbuffer.jpg
- the z-buffer image i obtained for the underlying plane - coons_zbuffer.jpg
Can Anyone tell me whats going wrong ? It would be a great help ....
What do! those z-values mean ??
Thanks in Advance.
Yahoo! Photos Ring in the New Year with <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://us.rd.yahoo.com/mail_us/taglines/photos/*http://pa.yahoo.com/*http://us.rd.yahoo.com/mail_us/taglines/photos/evt=38087/*http://pg.photos.yahoo.com/ph//page?.file=calendar_splash.html&.dir=" target="_blank">
Photo Calendars. Add photos, events, holidays, whatever.