Thanks everybody!
I will try to help how to slow down...
On the original script, the camera dont travel at a constant speed. I create the vector of difference between the final position and the actual position, and then scale this vector about the factor "t" , witch starts from 1 , and each frame it gets smaller by t-=0.002; , so the speed gets faster each frame...
You can change to t-=0.001; , but still is a little faster.
If you remove this line, the movements speed will be constant, but dont forget to declare t to be smaller than 1, otherwise the scale command will maitain the same distance, and the camera wont move.
So, if you want the camera to move really slow, what you can do is to remove the t-=0.002; , and when the t variable is declared as var t=1; just change it to var t=0.999; this will move really slow. The smaller the t variable, faster the movement.
Just to make sure, here is the original code:
Code:
function move_camera(){
proc_kill(4);
beep();
var a;var b;var c;var d;var t=1;
vec_for_vertex(a,my,9); // Posição final da camera,Point for camera to stay. Can use a Skill.
vec_for_vertex(b,my,10); // Posição p/ camera olhar,Point to look at. Can use a Skill too.
while(1){
///////////////////////////////////////////////////////// Gira a Camera, Turn camera.
vec_diff(d.x,b.x,camera.x);vec_to_angle(d.pan,d.x);
d.pan=ang(d.pan-camera.pan);d.tilt=ang(d.tilt-camera.tilt);
d.pan*=0.05;d.tilt*=0.05;
camera.pan+=d.pan;camera.tilt+=d.tilt;
if(camera.roll!=0){camera.roll-=sign(camera.roll)*time;}
///////////////////////////////////////////////////////// Translada a Camera, Translade camera.
vec_diff(c.x,camera.x,a.x);vec_scale(c,t);t-=0.002;
vec_add(c.x,a);if(t>0.002){vec_set(camera.x,c.x);}else{vec_set(camera.x,a.x);}
///////////////////////////////////////////////////////// Para o movimento.Break the movement.
if(mouse_right){break;}
wait(1);}
}
And this the one wich moves really slow:
Code:
function move_camera(){
proc_kill(4);
beep();
var a;var b;var c;var d;var t=0.999;
vec_for_vertex(a,my,9); // Posição final da camera,Point for camera to stay. Can use a Skill.
vec_for_vertex(b,my,10); // Posição p/ camera olhar,Point to look at. Can use a Skill too.
while(1){
///////////////////////////////////////////////////////// Gira a Camera, Turn camera.
vec_diff(d.x,b.x,camera.x);vec_to_angle(d.pan,d.x);
d.pan=ang(d.pan-camera.pan);d.tilt=ang(d.tilt-camera.tilt);
d.pan*=0.05;d.tilt*=0.05;
camera.pan+=d.pan;camera.tilt+=d.tilt;
if(camera.roll!=0){camera.roll-=sign(camera.roll)*time;}
///////////////////////////////////////////////////////// Translada a Camera, Translade camera.
vec_diff(c.x,camera.x,a.x);vec_scale(c,t);//t-=0.001;
vec_add(c.x,a);if(t>0.002){vec_set(camera.x,c.x);}else{vec_set(camera.x,a.x);}
///////////////////////////////////////////////////////// Para o movimento.Break the movement.
if(mouse_right){break;}
wait(1);}
}