Im trying to implement aum 34 the nice waves part.
i use the model provided and the code also
when i try run it in wed it appears funny
its missing a good chunk of it
can anyone help
here is the code below
define amplitude skill1;
define water_speed skill2;
define number_of_vertices 1089; // 33 x 33 in Med = 1089
////////////////////////////////////////////////////////////////////////////////////////
var vertex_array[number_of_vertices];
var counter;
var index;
////////////////////////////////////////////////////////////////////////////////////////
// uses amplitude, water_speed
action nice_waves
{
my.transparent = on;
my.passable = on;
my.alpha = 75;
my.ambient = -100;
if (my.amplitude == 0)
{
my.amplitude = 2; // default wave amplitude value
}
if (my.water_speed == 0)
{
my.water_speed = 10; // default wave speed value
}
counter = 0;
while (counter < number_of_vertices)
{
vertex_array[counter] = random(360); // set random values in vertex_array
counter += 1;
}
while (1)
{
index = 0;
while (index < number_of_vertices)
{
vec_for_mesh(temp, my, index); // store the vertex coordinates in temp
temp.z = sin(counter + vertex_array[index]) * my.amplitude; // change the z component
vec_to_mesh(temp, my, index); // deform the terrain entity
index += 1;
}
counter += my.water_speed * time;
wait(1);
}
}