Change camera positions automatically in 3d map

I have a 3d live route map which draws a flight route path and having a 3d flight object moving along with the route path. Now my requirement is that, if no actions done to the map manually, then it should automatically change the view of map, like change the view from top to bottom or right or left side. At the same time tracked entity should also work together.
I want a feature like this above example.
Any help would be appreciated


Hi there,

I think you will need to implement some custom functionality on top of CesiumJS to do this. You could add an event listener to the preRender event which adjust the camera accordingly based on the model’s boundingSphere property.

@Gabby_Getz Thank you so much for your reply.
It worked.

I have another question, hope you can help me to figure out.
I have a button which will rotate the camera to a 45 degree view, no matter where it started from. Rotation is working fine, but I need this to be animated. Now it looks like a sudden action, ie changing the camera rotation. Is there any function to animate this action?

Thanks in advance

“lerping”, or linearly interpolating, values is a common way to animate changes like this. See Cesium.Math.lerp. You can do something like: const nextValue = Cesium.Math.lerp(currentValue, targetValue, 0.9).

1 Like