【解决方法】var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); // 控制方向 设置不同的值方向不同
var orientation = Cesium.Transforms.headingPitchRollQuaternion(
position, // 实体所在位置
hpr
);
var polygon = viewer.entities.add({
id: ptag,
orientation: orientation, // 在实体中加入
polygon: {
height: height + hplus,
fill: pmts.fill != undefined ? pmts.fill : true,
material: '/BIMGenmodel/JD/MJ/BiaoPai/6.png',
outline: pmts.outline != undefined ? pmts.outline : true,
outlineColor: pmts.lcolor != undefined ? pmts.lcolor : new _Cesium.Color(1, 0, 0.8),
outlineWidth: 25,
hierarchy: new _Cesium.PolygonHierarchy(pos, null),
perPositionHeight:true,
},
});