I start several sequences of animation. Then start the first position from the beginning. In this case the FreeCamera starts correctly at the first position:
.....
var camera = new FreeCamera("freeCamera", camStartPosition, scene);
camera.setTarget(camTarget);
scene.activeCamera = camera;
setCamera(scene.activeCamera!);
movingInSpace: () => {
camera.position = camStartPosition;
camera.setTarget(camTarget);
let cam = camera;
var speed = 45;
var frameCount = 200;
var ease = new CubicEase();
ease.setEasingMode(EasingFunction.EASINGMODE_EASEINOUT);
var targetEndPos_pic0 = new Vector3(allPics.pic0.x, allPics.pic0.y, allPics.pic0.z);
var camEndPos_pic0 = new Vector3(allPics.pic0.x, allPics.pic0.y, 0.0);
Animation.CreateAndStartAnimation('at1', cam, 'position', speed, frameCount, cam.position, camEndPos_pic0, 0, ease);
Animation.CreateAndStartAnimation('at2', cam, 'target', speed, frameCount, cam.target, targetEndPos_pic0, 0, ease);
var targetEndPos_pic1 = new Vector3(allPics.pic1.x, allPics.pic1.y, allPics.pic1.z);
var camEndPos_pic1 = new Vector3(allPics.pic1.x, allPics.pic1.y, 0.0);
setTimeout(() => {
Animation.CreateAndStartAnimation('at1', cam, 'position', speed, frameCount, cam.position, camEndPos_pic1, 0, ease);
Animation.CreateAndStartAnimation('at2', cam, 'target', speed, frameCount, cam.target, targetEndPos_pic1, 0, ease);
}, 3000);
....
But if I rotate the scene and then start animation, then
the first start position of camera is different and wrong.
What could be the reason?
How do I reset the camera?
