How do I send a raycast from the mouse pointer position? Say for exmaple that I want to have a 3D ball at the position of where the mouse pointer "hits" the 3D world. How would I do that? I know there's c_trace, and Im guessing thats part of the answer. But the problem Im having is how youre supposed to translate the mouse's x, y coordinates in 2D space to a position/angle in 3D space from where the c_trace is supposed to occur.

Help?

EDIT:
Managed to Solve it now. Solution was to use cameras position for from vector, and vec_for_screen as to vector (i placed it 1000 units away).

So, for example:
c_trace(camera.x, vec_for_screen(vector(mouse_cursor.x, mouse_cursor.y, 1000), camera), IGNORE_ME);
vec_set(me.x, target);


Last edited by Kenchu; 03/01/08 18:10.