Hi Jumpu,
the main problem is that when you transform the movement to an angle vector, it is so small that the vector transforming maths sightly fails and each step gives you a shimmy orientation.
You can retrieve a bit further point into the spline to avoid this problem.
------------------------------------
Aupa Jumpu,
El problema reside en que el vector de desplazamiento es tan pequeño que al transformarlo en un vector angular, los cáculos que realiza no son lo suficientemente precisos y resultan en ese zigzagueo que comentas.
Puedes evitarlo utilizando un punto más alejado dentro del spline en vez de utilizar la posición anterior.
algo así:
action camera_path()
{
// create a dummy path entity
//me = ent_create(NULL,nullvector,NULL);
path_set(me,"path_000");
var dist = 0;
var vLastPos[3];
var vDir[3];
while(1)
{
// place the camera on the path
dist += 5*time_step;
path_spline(me,camera.x,dist);
// let the camera look ahead
path_spline(me,vLastPos,maxv(dist-1,0)); // 1 o más...
vec_diff(vDir,camera.x,vLastPos);
vec_to_angle(camera.pan,vDir);
//vec_set(vLastPos,camera.x);
wait(1);
}
}
Salud!