var x=2;
var flog=true;
//添加球体
var RedSphere = globalEarth.viewer.entities.add({
name: "Red sphere with black outline",
position: position,
ellipsoid: {
radii: new Cesium.Cartesian3(2,2,2),
material: Cesium.Color.RED.withAlpha(0.5),
outline: true,
outlineColor: Cesium.Color.BLACK,
},
//闪烁配置
ellipse : {
semiMinorAxis : 20.0,
semiMajorAxis : 20.0,
height : 0,
material:new Cesium.ColorMaterialProperty(new Cesium.CallbackProperty(function () {
if(flog){
x=x-0.05;
if(x<=0){
flog=false;
}
}else{
x=x+0.05;
if(x>=1){
flog=true;
}
}
return Cesium.Color.RED.withAlpha(x);
},false))
}
});
Cesium闪烁效果
于 2023-03-01 11:04:22 首次发布