left click pan doesn't work after removeing viewer.scene.preRender event

Hi all,
For this demo(https://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=5cb48d8bb08c4c9f2228f0179c08b687)
,What I want to do is to toggle the camera mode so it can track the entity along the path or just move camera freely.I tried to reset the camera by unregister event binded to viewer.scene.preRender,after doing this, when I drag the map by left clicking, it rotate the map instead.Did i miss something here?
Thanks
Ryan

Hi Ryan,

You can try manipulating the ScreenSpaceCameraControl options with viewer.scene.screenSpaceCameraController. You could even save the original state and just reset it to that when you toggle the camera mode.

Thanks,

Gaby

在 2017年10月21日星期六 UTC+8上午2:06:22,Gabby Getz写道:

Hi Ryan,

You can try manipulating the ScreenSpaceCameraControl options with viewer.scene.screenSpaceCameraController. You could even save the original state and just reset it to that when you toggle the camera mode.

Thanks,
Gaby

Hi all,

For this demo(https://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=5cb48d8bb08c4c9f2228f0179c08b687)

,What I want to do is to toggle the camera mode so it can track the entity along the path or just move camera freely.I tried to reset the camera by unregister event binded to viewer.scene.preRender,after doing this, when I drag the map by left clicking, it rotate the map instead.Did i miss something here?

Thanks

Ryan

--

You received this message because you are subscribed to the Google Groups "cesium-dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Gaby,

Thanks for the quick response.After some playing around it, I think the problem is that I set camera.lookattransform so left drag is somehow overridden and only map rotation is enabled.Is there a way to "remove" camera.lookattransform, but keep the current camera view at the same time?

Thanks
Ryan

Hi Ryan,

lookAtTransform is a function that sets the camera’s position and orientation one time. There shouldn’t be anything to “remove”, you should be able to update the position and orientation again at any time.

Can you provide a code sample perhaps?