Hi,
I use the following code when smoothly zooming in to the front of entities, but sometimes the camera shakes heavily when it is near its chosen/designated pan (/angle). It has seems to shake when the pan/angle of the target has decimals (/not a nice integer number).
This is e.g. with a fps of 50-60;
function cam_focusonentity()
{
while(...)
{
...
//change pan angle
if (1 < abs(target_ent.pan+180-camera.pan)) camera.pan += 4 * time_step * sign(ang(target_ent.pan-180 - camera.pan));
...
wait(1);
}
}
The code line is a bit long, but it was the only way I knew how to make it that the angle is changed evenly and always reached its target.
So anyone know how to prevent it from shaking?
[FOR SOLUTION SEE MY 2ND POST]