hi i use a 3d model as mouse cursor, placed it before the screen and traced to the clicktarget manually.
all works fine but. when i trace against vertical walls, the target.z value is too low.
has someone a glue what that is?
here is my code:
Code:
...
var cur[3];
var tgt[3];
// cursor positions on screen
cur.x = cur_screen_x;
cur.y = cur_screen_y;
cur.z = 0;
// trace-target position behind screen
vec_set(tgt.x, cur.x);
tgt.z = 4096; // behind screen
// make world coordinates from screen coordinates
vec_for_screen(cur.x, camera);
vec_for_screen(tgt.x, camera);
// trace to get target position
c_trace(cur.x, tgt.x, ignore_me + ignore_passable + activate_sonar);
// set target to *correct* values
vec_set(tgt.x, target.x);
// create particle at target position
ent_create("particle.tga", tgt.x, particle);
this code works fine except for tracing against vertical walls.
please help