How to free camera position after setting lookat?

I have a checkbox in gui which fixes the camera position like this:

viewer.camera.lookAt(cart, new Cesium.HeadingPitchRange(Cesium.Math.toRadians(cesiumController.heading),
Cesium.Math.toRadians(cesiumController.pitch), 10));

Now i want the camera to move freely when checkbox is disabled. How to achieve this? Is there anyway to undo lookat?

Hi Qandeel,

You can do so with ScreenSpaceCameraController.enableInputs.

viewer.scene.screenSpaceCameraController.enableInputs = true;

``

Thanks,

Gabby

Hello Gabby, its not working

Using Camera.setView will not change any of the camera controls, can you use that instead of Camera.lookAt?

I deliberately used lookAt because i wanted to fix the camera. This line solved my problem:

  •    viewer.camera.<ins>lookAtTransform</ins>(Cesium.<ins>Matrix4</ins>.<ins>IDENTITY</ins>);
    

``

Got it, thanks for the update!

Thank you
Your reply was helpful.

2018년 1월 8일 월요일 오전 8시 30분 17초 UTC+9, Qandeel Abbassi 님의 말: