I have:
- screen coordinates x,y (0,0 being the middle of the screen, 1,1 being top left)
- screen dimensions
- camera location vector
- camera look vector
- projection matrix
- ModelView matrix
- y=0 Plane normal of (0,1,0,0)
- y=0 plane location of (0,0,0,0)
And am looking to get the location (x,0,z) on the y=0 plane of where i click on my window (should be a line - plane intersection, but has to take into account the camera properties).
Annoyingly, I don't have the access to the GLU calls for unprojecting and the like. Just basic vector and matrix calculations. I don't really need the exact code as such, but just the technique - as a line plane intersection is easy enough to do. Finding the line that goes from the eye through the point on the screen is the hard part.
I thought it was just using the camera look vector for a ray projected from the camera location, but this doesn't take into account the mouse co-ordinates. So do i need to take into account the camera FOV too?