I have a polygon, which must move by a specified distance, upon clicking a button. I stumbled upon this interpolation example, wherein SampledPositionProperty is used to define the positions at different timestamps. However, in my usecase, I have a couple of differences compared to the example.
- I need to use a different clock/timer, than the one attached with the viewer/timeline, to animate the entity. This is because, the timeline is used to control a different variable associated with the entities. So is there a way to move the entities based on a different clock instance, which I instantiate?
- My entity is a polygon, for which the position is defined by the PolygonHierarchy, which takes in an array of positions. How can I use SampledPositionProperty for a PolygonHierarchy?
PS 1. I use Cesium 1.56.1 on Google Chrome 76.0.3809.132 on Windows 10.
PS 2. I looked into the Cesium source code to figure out how the position, at a given timestamp, is retrieved from the SampledPositionProperty. I believe there is some kind of an event listener that listens on the ontick event. But I couldn’t figure out where that code is. I would appreciate if I can be pointed out to that piece of code as well.
Thanks in advance.