CircleOutlineGeometry轮廓材质颜色怎么设置?

0 投票

使用CircleOutlineGeometry绘制了一个圆的轮廓,然后想设置轮廓的颜色,设置了appearance没有生效,但是给CircleGeometry就生效了,以下是我的代码,老师能帮忙看下哪里写的有问题吗?

var circleOutline = new Cesium.CircleOutlineGeometry({
  center : Cesium.Cartesian3.fromDegrees(116.45165939834018,39.90142089948198),
  radius : 100.0,
  height:10
});

var circleInstance = new Cesium.GeometryInstance({
	geometry:circleOutline ,
	attributes : {
	color : Cesium.ColorGeometryInstanceAttribute.fromColor(
		Cesium.Color.fromCssColorString("rgba(0,214,240, 0.5)"))
	},
});

var primitive = new Cesium.Primitive({
    geometryInstances : circleInstance,
    appearance : new Cesium.PerInstanceColorAppearance({
        translucent : true,
        closed : true
    })
});

viewer.scene.primitives.add(primitive);

3月 18 分类:  54次浏览 | 用户: 君莫笑 初出茅庐 (28 分)

1个回答

0 投票

修改颜色应该是通过下面的属性就行修改把,

cesium.ColorGeometryInstanceAttribute.fromColor
3月 18 用户: 那哲尘 名扬四海 (2,698 分)
...