I am testing a particle beam effect for a rocket trail (u may already know from my previous thread). I set vel_x/y/z to a vector handling the difference between rocket's position before and after its c_move() call (which normally controls its behaviour through arrow keys). Then, I checked if any of vel_x/y/z doesn't equal zero (which means that the rocket is moving) ,and if so, I randomize the vel_x/y/z vector by vec_randomize().
I use this image as a bmap for the effect:
Download link:
http://www.datafilehost.com/d/48c7bd08The problem is that: the particle doesn't look any good. It looks like cut strips or thin arcs (which is weird for a rocket trail). When I comment out vec_randomize() instruction, it doesn't look good either. It looks like the previous case. It takes the form of cut strips moving behind the rocket. Here are some screenshots:
1) If vec_randomize() is executed:
2) If vec_randomize() is commented out:
So, what am I doing wrong? Here's my code (Note that I don't use BRIGHT flag):
BMAP* smoke = "smoke.tga";
VECTOR dist_covered;
ENTITY* vehicle;
function p_fade_beamy(PARTICLE* p)
{
p.alpha -= 3*time_step;
if(p.alpha <= 0) p.lifespan = 0;
}
function p_beamy(PARTICLE* p)
{
VECTOR speed;
vec_set(p.vel_x,dist_covered.x);
if(p.vel_x != 0 || p.vel_y != 0 || p.vel_z != 0) vec_randomize(p.vel_x,1);
p.alpha = 100;
p.bmap = smoke;
p.size = 8;
set(p, MOVE | TRANSLUCENT | BEAM );
p.event = p_fade_beamy;
}
action movable_vehicle()
{
VECTOR temp;
VECTOR vtemp1;
VECTOR vtemp2;
vehicle = my;
while(1)
{
vec_set(vtemp1.x,my.x);
c_move(my,vector((key_cuu-key_cud)*5*time_step,0,0),nullvector,GLIDE | IGNORE_PASSABLE);
my.pan -= (key_cur-key_cul)*5*time_step;
vec_set(vtemp2.x,my.x);
vec_diff(dist_covered,vtemp1.x,vtemp2.x);
vec_set(temp.x,vector(-37,0,0));
vec_rotate(temp.x,my.pan);
vec_add(temp.x,my.x);
effect(p_beamy,40,temp.x,nullvector);
wait(1);
}
}
You can download a testing sample here (open through "main.c"):
http://www.datafilehost.com/d/38f7e3bdAlso, I wanted to ask: Does the particle function preserve my/you pointers from the calling
function? I know in C-script the my pointer is used to point to the particle ,but what about Lite-C?
Thank you for reading & any help would be appreciated

....