Best Way To Render History Trail of Dots?

I was wondering what the best method is for rendering a trail of history dots behind a moving entity.

I’ve read about the “path” attribute of an entity, but my needs don’t quite fit its use (I think. Please correct me if I’m wrong).

I’m receiving position updates periodically and modifying the entity’s position to match the latest data. I’d like to see a dot in it’s previous position after it gets moved to the latest update, with a max total number of history dots displayed.

What’s the best way to go about achieving this? I’m trying to maximize performance since there might be hundreds or thousands of entities.

Thanks!

I think you might need to create a new point entity each time the main entity moves, and keep track of deleting them after a certain number of time/updates. Check out this blog post for tips on rendering hundreds of thousands of points efficiently:

https://cesium.com/blog/2016/03/02/performance-tips-for-points/

Thanks for your response! I have a follow-up question.

Your link (which is much appreciated) speaks to the performance benefits of using a point primitive versus a billboard with a circle as an image. In your reply you also mentioned creating new point entities. Is the performance of creating an entity with only a point property the same as creating just the point primitive on its own? If not, would I see performance benefits by creating a PointPrimitiveCollection and populating it versus creating numerous entities that only contain points?

Thanks!

I think when you create many point entities, it essentially creates one PointPrimitiveCollection and populates (I’m fairly certain, but a quick benchmark test should prove this eitherway). Most of the Entity API automatically batches things to be as performant as possible. There are some cases, like for glTF models, where the entity API does not yet do this optimization (you can read more about that particular case in this GitHub issue: https://github.com/AnalyticalGraphicsInc/cesium/issues/7062)