That was easier than expected. I was trying to use draw_line using world co-ords instead of screen co-ords.
No wonder it looked weird...
Anyway, heres the NEW function, WORKING PERFECTLY based on spirits contribution.
It is NOW perfect, I discovered that if you allow the lerpfactor to go above
the 1.0 value, it will then extrapolate the line even if both point1 and point2
are on the same side of the Z-Plane.
FYI - By my testing, I
believe I have concluded that:
A lerpfactor of =0 means point1 and point2 are parallel to the Z-plane. (bad!)
A lerpfactor of >0 means the z_plane in on the point2 'side' of point1
A lerpfactor of <0 means the z_plane in on the point1 'side' of point2
A lerpfactor of 0 to 1.0 means the z_plane is between point1 and point2 (useful to someone else?)
A lerpfactor of -1.0 to 0 means the z_plane is between point2 and point1 (useful to someone else?)
Anyways, sorry KDuke, but I've got what I wanted and its nice and small, as you can see below.
And HUGE thankings go out to my new best friend spirit, whose advice to others has aided me in the past,
but this is the first time youve helped me directly. My gratitudes kind sir...
action place_block()
{
var Z_Offset = 180; VECTOR p1, p2;
while(me)
{
vec_set(p1, vector(mouse_pos.x,mouse_pos.y, 1)); vec_for_screen(p1,camera);
vec_set(p2, vector(mouse_pos.x,mouse_pos.y,10)); vec_for_screen(p2,camera);
if(p1.z!=p2.z) vec_lerp(me.x,p1,p2,-p1.z/(p2.z-p1.z));
me.z = Z_Offset;
wait(1);
}
}CASE CLOSED - For me anyway.