I was looking for an example of how to use EventSource or even better WebSockets to send dynamic updates of the data to Cesium but I wasn't able to find one.
Does anyone have some pointers or even better a complete example on how to handle dynamic data sending in Cesium?
I just started using Cesium with a websocket approach to dynamically add points to a line.
In the websocket onmessage function, I basically did the following:
var positions = polyline3D.getPositions();
positions.push(widget3D.centralBody.getEllipsoid().cartographicToCartesian(Cesium.Cartographic.fromDegrees(data.lon,data.lat,parseFloat(data.alt))));
polyline3D.setPositions(positions);
The solution (still testing) was to use many polyline collections where the polyline within a collection only has 1024 points. So every 1024 points, I would create a new polyline collection and a new polyline that would be used on the next websocket update.