How to Animate Camera lookAt movement

Hello, Is there any way to animate camera movement when camera.lookAt(mesh) function is called.
I have a case where I need to focus on the mesh and defocus with click on the button.
Advance thank you)

You might want to use Quaternion.rotateTowards() for this. Check out its usage here:

Inspired by Unity’s Quaternion.RotateTowards function.

1 Like

thank you very much for your response
I have this code but could you guide me what I did wrong

FocusModel: function() {
      var rotationMatrix = new THREE.Matrix4();
      var targetQuaternion = new THREE.Quaternion();
       //Number of animation frames
      var animFrames = 200;
      //Pause between two consecutive animation frames
      var deltaT = 1;
      const goSlerping = acc => {
        if (acc >= 1) return;
        if (
        ) {
          var step = 2 * acc;

        setTimeout(function() {
          goSlerping(acc + 1 / animFrames);
        }, deltaT);
      goSlerping(1 / animFrames);