The specific name of what I am trying to do is "unproject" = to map a screen point to the 3D world.
So I found this site which has simple equations for mapping 3D coordinates to a 2D screen:
http://www.petesqbsite.com/sections/tutorials/tuts/perspective.html
I've used these equations extensively, but now i want to be able to interact with the 3D world by hovering over the screen.
Rather than having the 2D coordinates be linked to the 3D objects I wanted to find an equation which maps onscreen points to the real. I tried reverse engineering the following 2 equations to try and find the answer:
screenPoint.x = (int) ((eye.z * (realPoint.x-eye.x)) / (eye.z + realPoint.z) + eye.x);
screenPoint.y = 480 - (int) ((eye.z * (realPoint.y-eye.y)) / (eye.z + realPoint.z) + eye.y);
However I was not successful (not mathematically possible).
Any help would be greatly appreciated!
Thanks!