How to simulate Camera Control to get same position, rotation and quarternion?

Following is existing code to move the camera to a certain position (note that cameraControl is an instance of CameraControl class):

cameraControl.dollyTo([5], true);
cameraControl.setPosition([2],[3],[4], true);
cameraControl.setFocalOffset([6],[7], 0, true);
cameraControl.rotateTo([1],[0], true);

Supposely after the above operations, my camera has moved to position p1, with rotation r1 and quarternion q1
My goal is not to use CameraControl to get the same view i.e. same p1, r1 and q1. Is it possible to achieve that?

I tried this to set the position

let vec = new THREE.Vector3([2],[3],[4]);

but this doesn’t make the camera’s position same as what camera control did.

Thank you for any help.

If by cameraControls, you mean @yomotsu/camera-controls, then you need to know that it has its own internal state, and it will reset the camera transformation from that state after each update.

You can use the toJSON/fromJSON methods, save the targeted state with toJSON, then apply it with fromJSON.

You also can’t control the camera rotation, since the cameraControls has a target, the camera will always look at that target. You can always move the target around.