Hey,
I got a code that create a kind of volumetric fog using a model. My problem is that my model is moving (you can see how in the code). I want the fog to also move.. how can I do this? thanks!
Code:
action cloud_object
{
my.skill1 = 0;
my.alpha = 98;
my.transparent = on;
while(1)
{
// generate cloud particals once
while (my.skill1 < ent_vertices(my)) // repeat till all vertices are passed
{
vec_for_vertex(temp.x,me,my.skill1);
if (temp.z < my.z)
{
temp.z -= random(20); //temp.z -= random(20);
temp.y += random(120)-60; //temp.y += random(120)-60;
temp.x += random(20)-10; //temp.x += random(20)-10;
effect(dark_cloud,1,temp,nullvector);
}
if (temp.z < my.z-200)
{
temp.z += random(20);
temp.y += random(120)-60; //temp.y += random(120)-60;
temp.x += random(10)-5;
effect(mid_cloud,1,temp,nullvector);
}
if (temp.z > my.z)
{
temp.z += random(20);
temp.y += random(120)-60; //temp.y += random(120)-60;
temp.x += random(10)-5;
effect(light_cloud,1,temp,nullvector);
}
my.skill1 += 1;
}
//my.skill1 = 0;
wait(1);
}
//MOVEMENT
// NOTE: LAISSER LE CHIFFRE AVANT TIME_STEP PAREIL POUR TOUTES LES ACTIONS DE L'ORAGE.
while(picked_angle == 0) { wait(1); } // wait until choose_way has run
my.pan = picked_angle;
while(1)
{
temp.x = 2*time_step; // change 2 to whatever speed you want
temp.y = 0;
temp.z = 0;
c_move(me,temp,nullvector,null);
wait(1);
}
}