cesium随笔记录-primitive、entity点击事件

对于primitive

var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);

handler.setInputAction(function(movement) {

  var pick = viewer.scene.pick(movement.position);

  console.log(pick)

  pick.primitive.appearance.material.uniforms.color=Cesium.Color.BLUE


},Cesium.ScreenSpaceEventType.LEFT_CLICK);

对于entity

pick.id.point.color=new Cesium.Color(1.0, 0.0, 0.0, 1);

或者官网中的entity.model.color

entity.model.color = getColor(newValue, viewModel.alpha);

————————————————

版权声明:本文为CSDN博主「A873054267」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/A873054267/article/details/103879210

你可能感兴趣的:(cesium随笔记录-primitive、entity点击事件)