Hey there,
I've got a question about smooth camera movement~
In many games with a third person camera the camera rotates smoothly around the player. Even if you stop touching the camera buttons the movement of the camera seems to stop smoothly not abrupt.
Even the Engine fly trough camera does this when you hit the 0 Button, move around and then stop pressing the arrow keys.
My problem is, that every single camera code I tried doesn't offer something like this. But how do you do something like this?
To specify my Problem, I am working on a role-playing game with a turn based battle system at the moment. Now i wanted to create some camera movements. For example when a Battle is going to begin the camera should move around the battlefield and show the enemies and the allies. I started with a simple circle movement around the battlefield. but the camera stops abrupt when it reaches the position where i want it to stop.
// ...
// I specify some startvalues
var camAngle = 350;
var camZoom = 600;
var camSpeed = 15;
// and set a focus for the camera
vec_set(tempFocus, camFocus);
while(camAngle > 225)
{
// this is supposed to slower the movement
camAngle -= ((camSpeed*camAngle)/1000) * time_step;
camera.z -= ((camSpeed*camAngle)/1000) * time_step;
camZoom -= ((camSpeed*camAngle)/1000) * time_step;
// i want it to move in a circle around my focus
camera.x = tempFocus.x + camZoom * cos(camAngle);
camera.y = tempFocus.y + camZoom * sin(camAngle);
// And the camera should keep its focus on the specified point
vec_set(temp, tempFocus.x);
vec_sub(temp, camera.x);
vec_to_angle(camera.pan, temp);
if(camAngle > 359){camAngle = 0;}
wait(1);
}
i'm fine with the movement itself but it should be more "smooth".
heres a little reference. You'll see a camera movement right at the beginning of the video. (ca. 0:08)
Final Fantasy X-2 Battle Any Ideas?
thanks in advance !
Roxas~