Original Post
Ok, this game is mostly 2d. All of the spaceships stay on the z=0 plane. Now I'm trying to use the mouse to tell my little spaceship where to go. So I punch the mouse coordinates into gluUnProject like so:
gluUnProject ( (double) mouse_x,
(double) mouse_y, 0.0,
modelMatrix, projMatrix, viewPort,
&x, &y, &z );
And I get back x,y,z. But the z is 1800 (where the camera is) and not 0 like I want. So now I suppose that I need to find out where a vector coming from the camera, passing through the x,y,z from the gluUnProject above, intersects the z=0 plane.
How do I do this? Unless of course there's an easier way...
Thanks in advance.
[edited by - JahToasted on January 17, 2004 2:34:49 AM]