|
Having a problem with draw_line and c_trace
#181850
02/04/08 02:04
02/04/08 02:04
|
Joined: Dec 2006
Posts: 434 UK,Terra, SolarSystem, Milky W...
pararealist
OP
Senior Member
|
OP
Senior Member
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
|
Hi, I am having a problem with drawline and c_trace. I am c_tracing: //-------- CODE: Start //-------- ... obstacle_distance = c_trace (actorEntity, vector(temprange,0,0), IGNORE_ME + USE_BOX); // and trying to draw a line to see the trace (was suspicious that trace was working - probably due to me) draw_line3d(vec_for_vertex(vLine,my,57),NULL,100); // start from vertex position draw_line3d(vec_for_vertex(vLine,my,57),vector(255,255,255),100); // start drawing draw_line3d(vec_normalize(vLine,temprange),vector(255,255,255),100); // draw the line : length = range. ... //-------- CODE: End //-------- this is the result i get: LINK: - to screenshot. http://pararealist.pa.funpic.de/squint.jpgcan anyone help ? - I may be doing something wrong ? Thanks
A8.3x Commercial, AcknexWrapper and VS 2010 Express ○pararealist now.
|
|
|
Re: Having a problem with draw_line and c_trace
[Re: vlau]
#181853
02/04/08 13:36
02/04/08 13:36
|
Joined: Dec 2006
Posts: 434 UK,Terra, SolarSystem, Milky W...
pararealist
OP
Senior Member
|
OP
Senior Member
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
|
I actually got the idea and code from there, thanks.
I have the feeling that i am missing something with draw_line3d.
The trace should go from the middle of the eyes to 250 quants ahead (X). The line would then be drawn to let me see the trace.
but the line gets drawn to the right (Y) from the eyes. (i hope the trace does not do too).
I have checked with other models, in case xyz origins different, but they all do the same thing.
So maybe its my code, that is why i posted to see if anyone can see a mistake in draw_line3d ?
A8.3x Commercial, AcknexWrapper and VS 2010 Express ○pararealist now.
|
|
|
Re: Having a problem with draw_line and c_trace
[Re: pararealist]
#181854
02/05/08 04:52
02/05/08 04:52
|
Joined: Aug 2005
Posts: 1,558 HK
vlau
Serious User
|
Serious User
Joined: Aug 2005
Posts: 1,558
HK
|
It's because the vertex normal is not parallel to the eyes, maybe try to draw the line from the eye's coordinate.
Also, with : obstacle_distance = c_trace (actorEntity, vector(temprange,0,0), IGNORE_ME + USE_BOX);
it always trace to world x-axis, that means when your character panned to face other direction, the ray will not follow, you have to vec_rotate the starting trace position.
|
|
|
|