Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Ayumi, kzhao, 7th_zorro), 735 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
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 Offline OP
Senior Member
pararealist  Offline 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.jpg

can 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: pararealist] #181851
02/04/08 06:33
02/04/08 06:33
Joined: Jul 2005
Posts: 34
Hong Kong
U
ultranet Offline
Newbie
ultranet  Offline
Newbie
U

Joined: Jul 2005
Posts: 34
Hong Kong
Can see the screenshot.

Re: Having a problem with draw_line and c_trace [Re: pararealist] #181852
02/04/08 10:04
02/04/08 10:04
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
You may try my "visibleTrace" demo.
Download it by clicking on my sig.

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 Offline OP
Senior Member
pararealist  Offline 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
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

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.

Re: Having a problem with draw_line and c_trace [Re: vlau] #181855
02/07/08 11:05
02/07/08 11:05
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
pararealist Offline OP
Senior Member
pararealist  Offline OP
Senior Member

Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
Thanks. will try this.


A8.3x Commercial, AcknexWrapper and VS 2010 Express
○pararealist now.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1