cesium笔记

1、cesium旋转矩阵 https://blog.csdn.net/u011575168/article/details/82914686

2、cesium坐标转换:

    ①笛卡尔→弧度→经纬度

    var ellipsoid=viewer.scene.globe.ellipsoid;
    var cartesian3=new Cesium.Cartesian3(x,y,z);
    var cartographic=ellipsoid.cartesianToCartographic(cartesian3);
    var lat=Cesium.Math.toDegrees(cartographic.latitude);
    var lng=Cesium.Math.toDegrees(cartographic.longitude);
    var alt=cartographic.height;

    ②经纬度→笛卡尔

    var cartesian3=Cesium.Cartesian3.fromDegrees(lon,lat.elev)

    ③百分度→弧度

    var lon_radians=Cesium.Math.toRadians(lon)

3、cesium通视分析思路 https://blog.csdn.net/cr196/article/details/77072814  

4、cesium禁止相机进入地下(未测试)  https://blog.csdn.net/thor027/article/details/82455649

viewer.clock.onTick.addEventListener(function () {        
        if(viewer.camera.pitch > 0){
            viewer.scene.screenSpaceCameraController.enableTilt = false;
        }
    }); 
    
    var mousePosition,startMousePosition;
    var handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);
    handler.setInputAction(function(movement) { 
        mousePosition=startMousePosition= Cesium.Cartesian3.clone(movement.position);
        handler.setInputAction(function(movement) {
            mousePosition = movement.endPosition;
            var y = mousePosition.y - startMousePosition.y;
            if(y>0){
                viewer.scene.screenSpaceCameraController.enableTilt = true;
            }
        }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
    }, Cesium.ScreenSpaceEventType.MIDDLE_DOWN);

5、cesium默认鼠标操作事件 https://blog.csdn.net/caozl1132/article/details/88849101主要时利用了这个类Cesium.ScreenSpaceCameraController(scene),来修改鼠标操作方式;

例如:

//设置操作习惯,更换中键和右键

viewer.scene.screenSpaceCameraController.tiltEventTypes = [

    Cesium.CameraEventType.RIGHT_DRAG, Cesium.CameraEventType.PINCH,

 { eventType: Cesium.CameraEventType.LEFT_DRAG, modifier: Cesium.KeyboardEventModifier.CTRL },

 { eventType: Cesium.CameraEventType.RIGHT_DRAG, modifier: Cesium.KeyboardEventModifier.CTRL }

];

viewer.scene.screenSpaceCameraController.zoomEventTypes = [Cesium.CameraEventType.MIDDLE_DRAG, Cesium.CameraEventType.WHEEL, Cesium.CameraEventType.PINCH];

  cesium操作事件:Cesium.ScreenSpaceEventType

6、GIS常用算法  https://blog.csdn.net/cfy_qiangkeming/article/details/83643482

7、解决调用camera.lookAt方法后鼠标默认动作改变问题 https://blog.csdn.net/qq_39782968/article/details/90289705

_this.viewer.scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);

  

转载于:https://www.cnblogs.com/implementer/p/11236181.html

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
©️2021 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值