Hi Omar,
I have discovered some interesting things playing with Cesium versions. Here is the code I am using and that you can use to verify my results:
var viewer = new Cesium.Viewer('cesiumContainer', {
imageryProvider : Cesium.createTileMapServiceImageryProvider({
url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII')
}),
baseLayerPicker : false,
geocoder : false,
requestRenderMode : true,
maximumRenderTimeChange : Infinity
});
var dataSource = new Cesium.CustomDataSource("custom");
viewer.dataSources.add(dataSource);
var redPolygon = dataSource.entities.add({
name : 'Red polygon on surface',
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0,
-115.0, 32.0,
-107.0, 33.0,
-102.0, 31.0,
-102.0, 35.0]),
material : Cesium.Color.RED
}
});
setInterval(render, 500);
setInterval(updateArea, 2000);
function render(){
viewer.scene.requestRender();
}
var i = 0;
function updateArea(){
dataSource.entities.removeAll();
var redPolygon = dataSource.entities.add({
name : 'Red polygon on surface',
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0,
-115.0, 32.0,
-107.0, 33.0,
-102.0, 31.0,
-102.0 + i, 35.0 + i]),
material : Cesium.Color.RED,
perPositionHeight : true
}
});
i += 0.5;
}
The conclusions are:
1) This code works nice in version 1.50, the update of the shape is smooth with no blinking.
2) This code does NOT work in version 1.57, the polygon blink everytime is updated. To get the same smoothness I will need to use the CallbackProperty that leads to high GPU consumption.
3) If the property "perPositionHeight" of the polygon is removed it does not work in any of the versions.
I think it should work always as 1) so it migth be a bug.
Regards,