利用Cesium.clone(),轻松加载飞机模型双胞胎,而且不卡顿。
注意:不要直接克隆entity,因为ID冲突,无法加载到场景中。
var position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, height);
var position1 = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503006, height);
var heading = Cesium.Math.toRadians(135);
var pitch = 0;
var roll = 0;
var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr);
var entity = viewer.entities.add({
name : url,
position : position,
orientation : orientation,
model : {
uri : url,
minimumPixelSize : 128,
maximumScale : 20000
}
});
viewer.trackedEntity = entity;
var entity_model = Cesium.clone(entity.model);
viewer.entities.add({
name : url,
position : position1,
orientation : orientation,
model : entity_model
});
---------------------
作者:Alice爱俪丝
来源:CSDN
原文:https://blog.csdn.net/qq_18144905/article/details/82416143
版权声明:本文为博主原创文章,转载请附上博文链接!