Login  Register

Re: mouse input

Posted by Irene Tang on Mar 03, 2016; 10:33am
URL: https://forum.jogamp.org/SOLVED-mouse-input-tp3504609p4036416.html

If the clicking point has been rendered, then I can get z-depth by gl2.glReadPixels(sx, viewportMatrix[3] - sy, 1, 1, GL2.GL_DEPTH_COMPONENT, GL2.GL_FLOAT, FloatBuffer.wrap(winZ)). Else I get 1.0, so if I use 1.0 to calculate the corresponding point on world space, the result might be wrong.