mouse_pos.z = mouse_cursor.z; ?
Ich denke mal, dass der mouse_pos.z einen anderen wert oder NULL haben muss.
die position des Mauszeigers hat nur x und y , diese müssen dann in eine
3d position umgewandelt werden. Aber einen "mouse_cursor.z" gibt es nicht.
Hier mal ein Beispiel aus einem anderen Code:
// First we get the mouse coordinates (2D)
temp.x = mouse_pos.x;
temp.y = mouse_pos.y;
temp.z = 0;
// Set "target" to the same coordinates
vec_set(target,temp);
// Add some depth/dist. from screen, to "target"
target.z = 10000;
// Convert from 2D screen coordinates, to 3D world coordinates
vec_for_screen(temp,camera);
vec_for_screen(target,camera);
// Trace from temp (mouse pos.) to target
c_trace (temp,target,IGNORE_ME|IGNORE_PASSABLE|SCAN_TEXTURE);
Last edited by jane; 10/11/10 12:46.