当前位置: 首页 > news >正文

合肥网站建设服务公司银川制作网站

合肥网站建设服务公司,银川制作网站,html5门户网站模版,网站建设实训个人可以直接settimeout隔一段时间直接设置位置属性#xff0c;但是得到的结果模型不是连续的移动#xff0c;如果想要连续的移动#xff0c;就需要设置一个时间轴#xff0c;然后给模型传入不同时间时的位置信息#xff0c;然后就可以了。 开启时间轴 let start Cesium.Jul…可以直接settimeout隔一段时间直接设置位置属性但是得到的结果模型不是连续的移动如果想要连续的移动就需要设置一个时间轴然后给模型传入不同时间时的位置信息然后就可以了。 开启时间轴 let start Cesium.JulianDate.fromDate(new Date()); // 设置时间轴当前时间为开始时间start Cesium.JulianDate.addHours(start, 8, new Cesium.JulianDate())//东八区let stop Cesium.JulianDate.addSeconds(start, 400, new Cesium.JulianDate()) viewer.clock.startTime start.clone()// 设置时钟当前时间viewer.clock.currentTime start.clone()// 设置时钟结束时间viewer.clock.stopTime stop.clone();// 数字越大时间过的越快viewer.clock.multiplier 10// 循环执行viewer.clock.clockRange Cesium.ClockRange.LOOP_STOP; 想让模型跟随移动方向切换方向 orientation : new Cesium.VelocityOrientationProperty(position) 但是刚开始机头的朝向并不是速度的方向所以一直会偏差查询之后发现有点复杂初学者还是暂时放弃 飞机整体代码这样,这里有个小坑原生cesium你要绑定时间轴还需要设置availability但是supermap这个没有你加上就没有图像了 var planenew Cesium.Entity({position:property,model: {uri:src/assets/gltf/plane/scene.gltf,minimumPixelSize: 128, //模型最小像素maximumScale: 200, //模型最大放大倍数},orientation: new Cesium.VelocityOrientationProperty(property)})viewer.entities.add(plane)function computeFlight(source:any) {let property new Cesium.SampledPositionProperty();for (let i 0; i source.length; i) {//时间间隔let time Cesium.JulianDate.addSeconds(start, source[i][2], new Cesium.JulianDate);//坐标和高度let position Cesium.Cartesian3.fromDegrees(source[i][0], source[i][1], 600);property.addSample(time, position);}return property; } 在后面加一条轨迹线 const entityPath new Cesium.Entity({position: property,path: {show: true,leadTime: 0,trailTime: 30,width: 6,resolution: 1,material:Cesium.Color.YELLOW,},}); 初学做的不好后面学多了会做好看的 总的代码 templatediv classPartOneBoxdiv idcesiumContainer/div/div /templatescript setup langts import { ref, reactive,onMounted} from vueconst plane1Position[[104.173,30.822,0],[104.178,30.837,100],[104.19,30.837, 200],[104.185,30.82,300],[104.173,30.822,400],]let start Cesium.JulianDate.fromDate(new Date()); // 设置时间轴当前时间为开始时间start Cesium.JulianDate.addHours(start, 8, new Cesium.JulianDate()); // 开始时间加8小时改为北京时间let stop Cesium.JulianDate.addSeconds(start, 400, new Cesium.JulianDate()); // 设置结束时间为开始时间加400秒onMounted(async() {let viewer new Cesium.Viewer(cesiumContainer)// 设置时钟开始时间viewer.clock.startTime start.clone();// 设置时钟当前时间viewer.clock.currentTime start.clone();// 设置时钟结束时间viewer.clock.stopTime stop.clone();// 时间速率数字越大时间过的越快设置1好像是和实际时间一样viewer.clock.multiplier 20// 循环执行到达终止时间重新从起点时间开始viewer.clock.clockRange Cesium.ClockRange.LOOP_STOP;var labelImagery new Cesium.TiandituImageryProvider({mapStyle: Cesium.TiandituMapsStyle[IMG_C],//天地图全球中文注记服务token: 你的 //由天地图官网申请的密钥});viewer.imageryLayers.addImageryProvider(labelImagery);viewer.camera.setView({destination: Cesium.Cartesian3.fromDegrees(104.18,30.83,3500)})var geo new Cesium.Entity({position:Cesium.Cartesian3.fromDegrees(104.18,30.83,1650),wall:{positions:Cesium.Cartesian3.fromDegreesArrayHeights([104.173,30.822,400,104.178,30.837,400,104.19,30.837, 400,104.185,30.82,400,104.173,30.822,400,]),material:Cesium.Color.RED.withAlpha(.4),outline: true,},polyline:{positions:Cesium.Cartesian3.fromDegreesArrayHeights([104.18,30.83,0,104.18,30.83,1600]),material:Cesium.Color.BLUE,width:5},label: {text: 好的大学没有围墙, font: 14px sans-serif, showBackground: true,backgroundColor:new Cesium.Color(50,50,50,.6)},})let property computeFlight(plane1Position) var planenew Cesium.Entity({position:property,model: {uri:src/assets/gltf/plane/scene.gltf,minimumPixelSize: 128, //模型最小像素maximumScale: 200, //模型最大放大倍数},orientation: new Cesium.VelocityOrientationProperty(property)})const entityPath new Cesium.Entity({position: property,path: {show: true,leadTime: 0,trailTime: 30,width: 6,resolution: 1,material:Cesium.Color.YELLOW,},});viewer.entities.add(geo)viewer.entities.add(plane)viewer.entities.add(entityPath)}) function computeFlight(source:any) {let property new Cesium.SampledPositionProperty();for (let i 0; i source.length; i) {//时间间隔let time Cesium.JulianDate.addSeconds(start, source[i][2], new Cesium.JulianDate);//坐标和高度let position Cesium.Cartesian3.fromDegrees(source[i][0], source[i][1], 600);property.addSample(time, position);}return property; }/scriptstyle scoped langscss .PartOneBox {width:1200px;height:1000px;margin:50px auto;position:relative;.cesiumContainer{width:100%;height:100%;} }/style
http://www.dnsts.com.cn/news/63277.html

相关文章:

  • 网站建设小厦门网站设计公司找哪家福建小程序开发
  • 电子商务网站建设市场营销型网站建设策划书怎么写
  • 网址站点异常怎么解决漳州 网站建设公司哪家好
  • 怎么做免费的网站空间建筑英才网首页
  • 烟台北京网站建设音乐类网站建设选题背景
  • 网站建设开发电销话术wordpress文章静态化
  • 网站开发工程师职责单位网站建设目的
  • 网站建设图片链接方法阿里企业邮箱下载
  • 网站建设相关的博客有哪些做的比较好的车载嗨曲网站
  • 银川网站建设是什么10岁一12岁的创意手工
  • 做类型网站做名片最好的网站
  • 郑州做网站那静态网站是什么样
  • 网站的推广方案怎么写产品网络营销分析
  • 网站建设企业站模板数字营销师证书
  • 二手交易网站开发方式qq官网
  • 外贸自建站类型90平方装修全包价格
  • 工信部网站域名备案查询网址短链接生成器
  • 有哪些网站制作公司抖音的电子商务网站建设
  • 制作网站的方法网络广告营销的特点
  • seo案例网站企业网站为什么打不开
  • 网站收录很慢重庆网页制作设计营销
  • 南康网站建设公司宿州北京网站建设
  • 网站开发用户需求说明书太平洋手机网报价大全
  • 游戏是怎么做的视频网站福建住房和建设网站密码忘记
  • 网站设计需求分析seo如何进行优化
  • 做自媒体怎么在其它网站搬运内容瑞安市公用建设局网站
  • 天河网站开发广告图片怎么制作
  • flash网站的制作网站设计论文总结
  • 东坡区建设局网站网站导航固定代码
  • 东莞市网站建设公司哪家好重装电脑后下载wordpress