dynamic polyline cesium(best practices?)

Well i still dont understand what is the best practices of drawing dynamic polyline.

let me explain the scenario, there is an event dont every ~30ms happend , in this event i want to draw polyline with constant point and dynamic point that located on a specific imaginery circle.

i want to visualized the circle like the radius whom represented by the polyline is moving around the circle , so lets asume in every 30ms the center point of the circle is always the same point and the other point change along with radius of the circle and the specific angle so lets asume in every 30ms the poline rotate right like the clock.

its like visual clock that every 30ms is moving one angle till it gets to the 360 and then returened to 0 and etc..

how can i implement this kind of animation using best performances?


I would recommend using a callback property to update the positions in the polyline. Here is an example:

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var position1 = Cesium.Cartesian3.fromDegrees(-75, 35);
var lon = -75;
var position2 = Cesium.Cartesian3.fromDegrees(lon, 35);
var positions = [position1, position2];
function callback(){
lon -= 0.05;
position2 = Cesium.Cartesian3.fromDegrees(lon, 35, undefined, undefined, position2);
return positions;

polyline : {
positions : new Cesium.CallbackProperty(callback, false),
width : 5,
material : Cesium.Color.RED