   glreadpixels and gluProject always return 1
  Underneath code is gives always 1 back (well 0.99999)newPoint.setTo(p.get(i), p.get(i+1), p.get(i+2));if(currentCamera.pointInFrustum(newPoint.getX(), newPoint.getY(), newPoint.getZ())){get2DProjection(newPoint.getX(), newPoint.getY(), newPoint.getZ(), imageViewport, projection);which is strange, coz those points are not on the far plane?any solutions?tiaPaul   
Quote:Original post by gorgorathUnderneath code is gives always 1 back (well 0.99999)newPoint.setTo(p.get(i), p.get(i+1), p.get(i+2)); if(currentCamera.pointInFrustum(newPoint.getX(), newPoint.getY(), newPoint.getZ())){ get2DProjection(newPoint.getX(), newPoint.getY(), newPoint.getZ(), imageViewport, projection);which is strange, coz those points are not on the far plane?any solutions?tiaPaul Mind posting your actual OpenGL calls?  I think your problem is the very common one of losing depth precision because of having your near plane too close and/or your far plane too far away.  But I can't be sure without seeing any OpenGL function calls.   ;  initially the nearplane was set to 1 while the far plane was 1000000.which seems imo good, coz the points are scattered over a range 10000. so the z values should at least show some variation. changing the near/farplane didn't lead to other results.edit: the projected x, y values are correct   ;Quote:Original post by gorgorathinitially the nearplane was set to 1 while the far plane was 1000000.which seems imo good, coz the points are scattered over a range 10000. so the z values should at least show some variation. changing the near/farplane didn't lead to other results.edit: the projected x, y values are correctWhat did you try changing the near and far values to?  The depth buffer is not linear; a lot of precision is used close to the camera and very little is used far away.  For the most part you want to minimize the far-to-near ratio to most effectively use your depth buffer precision.  1000000:1 is VERY large.  For a near value of 1 and a far value of 1000, there's about 99% of the depth precision in the nearest 9% of the view volume (something like that, I don't feel like going through the math).  So if your points are scattered in a range of 10000 close the back of the view volume (say 800k - 810k) I would expect all returned depth values to be 0.9999999...In any case, your OpenGL code would (still) be of help.   