标签:data tor led string models minimum oat math min
本文示列 模型的添加、删除。
//添加模型(方法一)
var position = Cesium.Cartesian3.fromDegrees(108, 34, 500); var heading = Cesium.Math.toRadians(90); var pitch = Cesium.Math.toRadians(-30); var roll = Cesium.Math.toRadians(0); var hpRoll = new Cesium.HeadingPitchRoll(heading, pitch, roll); var fixedFrameTransform = Cesium.Transforms.localFrameToFixedFrameGenerator(‘north‘, ‘west‘); var model = viewer.scene.primitives.add(Cesium.Model.fromGltf({ url:‘../SampleData/models/CesiumAir/Cesium_Air.gltf‘, scale:100, modelMatrix: Cesium.Transforms.headingPitchRollToFixedFrame(position, hpRoll, Cesium.Ellipsoid.WGS84, fixedFrameTransform), show:true, id:‘feiji‘, minimumPixelSize:0, maximumScale:100, color:Cesium.Color.fromCssColorString(‘rgba(255,250,250,1)‘) }))
//删除模型
viewer.scene.primitives.remove(model);
//添加模型(方法二)
var entity = viewer.entities.add({ position : Cesium.Cartesian3.fromDegrees(108, 34,0), model : { uri : ‘../SampleData/models/CesiumAir/Cesium_Air.gltf‘, show:true, scale:100, minimumPixelSize:1, maximumScale:100, silhouetteColor : Cesium.Color.fromAlpha(Cesium.Color.GREEN, parseFloat(0.5)), color : Cesium.Color.fromAlpha(Cesium.Color.RED, parseFloat(0.5)) } })
//删除模型
viewer.entities.remove(entity);
标签:data tor led string models minimum oat math min
原文地址:https://www.cnblogs.com/MaShuai666/p/9949683.html