Gamestudio Links
Zorro Links
Newest Posts
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 (Baklazhan, AndrewAMD, Ayumi, Hanky27), 1,277 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Drawing a line of particles #437636
02/20/14 21:04
02/20/14 21:04
Joined: Apr 2005
Posts: 796
U.S.A. Michigan
exile Offline OP
User
exile  Offline OP
User

Joined: Apr 2005
Posts: 796
U.S.A. Michigan
Hey guys, I am trying to utilize a for loop to draw a line of particles. In the end I am trying to achieve something that works like draw_line3d. I wouldnt be here asking this question if Conitec would just include the formulas for their draw functions in the manual tongue Anyway, I am trying to do something similar to this;

VECTOR temp;
distance = vec_dist(pos_a.x,pos_b.x);
for(i=0; i<distance; i++)
{
effect(pulse_ef_a_base,1,vector(temp.x+i, temp.y, temp.z),nullvector);
}

As you can already guess this wont work. I am not the best at math so I was wondering if someone could help me figure out how to get this to work. To reiterate, I am trying to draw a line of particles from pointA to pointB using a 'for' loop. Thanks to whoever can help me laugh

Re: Drawing a line of particles [Re: exile] #437638
02/20/14 21:48
02/20/14 21:48
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
use BEAM if possible. just set your offset/distance into velocity and don't set move.
else use lerp:
Code:
VECTOR temp;
distance = vec_dist(pos_a.x,pos_b.x);
var per_quant = 4;
for(i = 0; i <= per_quant * distance; i++)
{
vec_lerp(temp, pos_a, pos_b, i / (per_quant * distance));
effect(pulse_ef_a_base,1,temp,nullvector);
}



Visit my site: www.masterq32.de
Re: Drawing a line of particles [Re: MasterQ32] #437640
02/20/14 21:55
02/20/14 21:55
Joined: Apr 2005
Posts: 796
U.S.A. Michigan
exile Offline OP
User
exile  Offline OP
User

Joined: Apr 2005
Posts: 796
U.S.A. Michigan
And of course, it was something I thought of but said "Naahhhh, that wouldn't work" tongue

Thanks MasterQ32, I owe you one! Consider this topic solved/closed.


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