Android how to get opengl 3D coordinates in ontouch event
- by Sandy
I created a cube in opengl and it rotates in ontouch event. To to this I created a CustomSurfaceView as follows
public class CustomSurfaceView extends GLSurfaceView {
@Override
public boolean onTouchEvent(MotionEvent e) {
float x = e.getX()
float y = e.getY();
}
}
Here x and y are screen coordinates. How can I get 3D coordinated from this? I have already looked gluProject and NeHe. But I dont know how to implement this in my project, it shows that there is no GLdouble,GLfloat class.