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

32 views
Skip to first unread message

asu.x...@gmail.com

unread,
Oct 19, 2017, 2:19:47 AM10/19/17
to cesium-dev
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

Gabby Getz

unread,
Oct 20, 2017, 2:06:22 PM10/20/17
to cesium-dev
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


--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

asu.x...@gmail.com

unread,
Oct 20, 2017, 10:59:13 PM10/20/17
to cesium-dev
在 2017年10月21日星期六 UTC+8上午2:06:22,Gabby Getz写道:
> 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

Gabby Getz

unread,
Oct 24, 2017, 4:59:47 PM10/24/17
to cesium-dev
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?

To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages