第一视角
Cesium中的相机—四元素:https://blog.csdn.net/u011575168/article/details/83034048
Cesium官方教程6--相机:https://www.cnblogs.com/cesium1/p/10063020.html
相机的高度和飞机的高度不同。。。
利用:
viewer.camera.flyTo({ destination : Cesium.Cartesian3.fromDegrees(lng, lat,alt), orientation : { heading : Cesium.Math.toRadians(0.0), pitch : Cesium.Math.toRadians(-90.0), roll : 0.0 } });
var handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas); handler.setInputAction(click => { this.viewer.clock.onTick.removeEventListener(onTickCallback); //查看当前视角的 x,y,z,heading,pitch,roll值 var e = click; var position = this.viewer.scene.pickPosition(e.position); //将笛卡尔坐标转化为经纬度坐标 var cartographic = Cesium.Cartographic.fromCartesian(position); var x = Cesium.Math.toDegrees(cartographic.longitude); var y = Cesium.Math.toDegrees(cartographic.latitude); var z = cartographic.height; var h = this.viewer.scene.camera.heading; var p = this.viewer.scene.camera.pitch; var r = this.viewer.scene.camera.roll; handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK) }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
参考:https://blog.csdn.net/qq_29808089/article/details/108464481
>>参考:UAV-simulation: 基于Cesium的无人机飞行模拟 (https://gitee.com/KivenGood/uav-simulation)
//移动模型 function moveModel() { // tempLng += (step * correction); // tempLat -= (step * Math.sin(tempHeading)); //主要用来左右移动 //tempLat += step tempLat = +msg[0].GPS_LAT_CA - 10; tempLng = +msg[0].GPS_LONG_CA - 3.5; // tempHeight = +msg[0].ALT_STD+1000; tempHeight = 2000; // tempRoll = +msg[0].ROLL_RATE1; localStorage.setItem("msg", JSON.stringify(msg[0])); console.log("localStorage:" + JSON.stringify(JSON.parse(localStorage.getItem("msg")))); console.log("msg.length1:" + msg.length); console.log("***tempLng:" + tempLng); console.log("***tempLat:" + tempLat); console.log("***tempHeight:" + tempHeight); console.log("***tempHeading:" + tempHeading); console.log("***tempPitch:" + tempPitch); console.log("*** tempRoll:" + tempRoll); var position = myCesium.Cartesian3.fromDegrees(tempLng, tempLat, tempHeight); var hpr = new myCesium.HeadingPitchRoll(tempHeading, tempPitch, tempRoll); var orientation = myCesium.Transforms.headingPitchRollQuaternion(position, hpr); myEntity.orientation = orientation; myEntity.position = position; msg.shift(); console.log("!!!!msg[0].id" + msg[0].id); //受异步请求影响,state相当于一个锁,当数据请求结束才开锁 if (msg.length < 100 && state == 0) { console.log("!!!!!!"); state = 1; readData(); } document.getElementById('msg').innerHTML = "tempLng:" + tempLng; document.getElementById('msg1').innerHTML = "tempLat:" + tempLat; document.getElementById('msg2').innerHTML = "tempPitch:" + tempPitch; document.getElementById('msg3').innerHTML = "tempHeight:" + parseInt(tempHeight); document.getElementById('msg4').innerHTML = "tempHeading:" + tempHeading; document.getElementById('msg5').innerHTML = "tempRoll:" + tempRoll; // document.getElementById('msg6').innerHTML = "step:" + step; document.getElementById('msg7').innerHTML = "correction:" + correction; }
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
2020-10-26 ArcObjects
2020-10-26 Dojo是什么?
2020-10-26 百度地图是什么坐标系?
2020-10-26 高德地图API
2020-10-26 地理POI数据爬取-以百度地图为例
2016-10-26 TurtleBot教程