var scene = viewer.scene;
var primitive = new Cesium.Primitive({
geometryInstances: new Cesium.GeometryInstance({
geometry: new Cesium.PolylineGeometry({
positions: Cesium.Cartesian3.fromDegreesArray([120.0,40.0,100.0,30.0]),
width:3.0,
vertexFormat:Cesium.PolylineColorAppearance.VERTEX_FORMAT
}),
attributes: {
color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED)
}
}),
appearance: new Cesium.PolylineColorAppearance({
translucent: false, //是否透明
})
});
scene.primitives.add(primitive);
利用primitive绘制了一条线,怎么样能改变primitive的position,采用直接赋值,位置未发生改变
let newPosition = Cesium.Cartesian3.fromDegreesArray([117.0,20.0,90.0,25.0])
primitive._position = newPosition ;