isboyjc

第 371 位会员

会员
个人信息
  • 加入于 2019-09-19 11:36:10
  • 城市 北京
  • GitHub https://github.com/isboyjc
  • 最后登录时间 3年前
  • 签名 不正经的前端
个人成就
  • 发表文章次数 2
  • 发布回复次数 4
  • 个人主页浏览次数 29
Cesium中3DTiles倾斜模型放大缩小的问题3年前

对于新版本模型旋转直接就飞了,原因是旋转中心不对,cesium包的旋转中心是地球中心,想要解决这个问题,可以先把模型平移到球心,然后旋转,再平移回来

也可以按照上面方式取巧,上面代码没有贴完整不好意思,xyz是位置,这个位置自己选择就是旋转的中心点,RotateX,RotateY,RotateZ是xyz坐标平移什么的

Cesium中3DTiles倾斜模型放大缩小的问题4年前

up3dtilesMaxtrix() {
      tileset.readyPromise.then(function(argument) {
        let x = "298.29725",
          y = "145.03273",
          z = "0";
        let RotateX = 0,
          RotateY = 10,
          RotateZ = -94;
        //旋转
        let mx = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(RotateX));
        let my = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(RotateY));
        let mz = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(RotateZ));
        let rotationX = Cesium.Matrix4.fromRotationTranslation(mx);
        let rotationY = Cesium.Matrix4.fromRotationTranslation(my);
        let rotationZ = Cesium.Matrix4.fromRotationTranslation(mz);
        //平移
        let position = Cesium.Cartesian3.fromDegrees(x, y, z);
        let m = Cesium.Transforms.eastNorthUpToFixedFrame(position);
        // 缩放
        let scale = Cesium.Matrix4.fromUniformScale(3);
        //旋转、平移、缩放矩阵相乘
        Cesium.Matrix4.multiply(m, rotationX, m);
        Cesium.Matrix4.multiply(m, rotationY, m);
        Cesium.Matrix4.multiply(m, rotationZ, m);
        Cesium.Matrix4.multiply(m, scale, m);
        //赋值给tileset
        tileset._root.transform = m;

        viewer.zoomTo(tileset);
      });
    },

已解决

cesuim可以使用高德的自定义地图作为底图么?4年前

这边最后解决方案是使用了定制的mapbox地图做为底图,没有用高德

cesuim可以使用高德的自定义地图作为底图么?4年前

你好,这个问题解决了吗,我这边也要用定制地图,求指点

Your Site Analytics