Find position in 3D model from position on 2D screen
Posted by nabo on
URL: https://forum.jogamp.org/Find-position-in-3D-model-from-position-on-2D-screen-tp4025324.html
Hi,
i'm just starting with jogl and i have a problem:
i have a ground plane (something like a chess board) and i'm showing a view from diagonally above in an angle of roundabout 30° in a JFrame (like the view was in e.g. age of empires).
Now i've added a MouseListener that returns me the position of the mouse on my screen on clicking. How do i find out which square i clicked?
The MouseListener gives me x and y on the 2D screen. How do i convert them into the coordinates of the underlying square on the ground plane?
Sorry if i explained in a complicated way or ask something easy. Any help very welcome!