Picking in the volume??

Hi there,
I have five identical objects and picking works fine when they are visible on the screen plane (no overlapping) or even partially overlapping. After rotating some and get them overlapped so that only the one nearest to the observer is visible, all others are hidden behind it. Why is nothing picked when it is clicked in the center or with in the object’s boundary?
Is not it supposed to pick all in a certain volume defined by “glu.gluPickMatrix…” ? It picks only the one nearest when clicked nearby within the boundary defined again by “glu.gluPickMatrix…”. Can any body tell me what is going on??
Thanks…

I had the same problem. But check if any of your gl/glu-functions really work in the context in which you are trying to call gluPickMatrix for example. Mine didn’t. The way I got suspicious was when the array in the call glGetIntegerv(GL_VIEWPORT, array) was always returned with all zeros. This is some problem with threads as I understand. You have to get a hold of the current rendering thread. For example in display(GLDrawable gld) :
GL gl = gld.getGL();

Hope that helps…

Thanks for response.
Every thing is fine, I dont know why the first rendered oject is not picked.
I think some thing is wrong with my program.
Thanks.

Hamareno,
Was the number of hits a non-zero value while you were gettting all zero for the data int[] buffer? This was happening once in a while or a continious thing? It seems It depends on the rendering load. With smaller number of objects rendered, I does not happen.I am very careful on this thread issue but still once out of 10 press my program returns data int[] buffer with all zero despite the hit is correct, a non-zero number.
Thanks…