I have trouble of finding the hitpoint on the 3d space. I currently have viewport data which is the screen size, the depth from camera to the object (object is = plane parallel with the screen), and the mouse pointer on the screen.

I am using opengl es 2.0, how do if ind the hit point on the object which was parallel with the camera.

The two lines below, i did that because the screen coordinates starting from the center of the screen and towards left as a positive x-axis and upwards as positive for y-axis. whereas towards the right was negative and toward bottom is negative.

point.x *= -1;
point.y *= -1;

jhonyourangel

04-30-2014, 12:49 AM

Hi, i have the same problem.
The problem of the screen coordinate i fixed with the :

i am able to select the "cube" if is close to the camera, but as it goes far from the camera, the coordinates are very incorrect.
I have to shoot a ray, but i can't figure how to retrieve the intersection.
I am trying to work it out with an inverse matrix from the mouse position to the position of the object, this way my matrix will not move to center of the screen when is moving far from the camera, but it will move in the other direction.