Cesium1.6.3版本以上,3dtiles旋转问题

Cesium源码 · ddchyy · 于 4年前 发布 · 5861 次阅读

// var mx = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(0))

  // var my = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(45))
  // var mz = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(0))
  // var rotationX = Cesium.Matrix4.fromRotationTranslation(mx)
  // var rotationY = Cesium.Matrix4.fromRotationTranslation(my)
  // var rotationZ = Cesium.Matrix4.fromRotationTranslation(mz)
  // 平移
  var heightOffset = 20.0
  var boundingSphere = tileset.boundingSphere
  var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center)
  var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0)
  var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset)
  var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3())
  var result = Cesium.Matrix4.fromTranslation(translation)
  // 旋转、平移矩阵相乘
  // Cesium.Matrix4.multiply(result, rotationX, result)
  // Cesium.Matrix4.multiply(result, rotationY, result)
  // Cesium.Matrix4.multiply(result, rotationZ, result)
  // 赋值给tileset
  tileset.modelMatrix = result

位置偏移可以实现,但旋转矩阵相乘之后,赋值给tileset.modelMatrix,模型飞了,请问什么原因

本文由 cmccmz 创作,采用 知识共享署名 3.0 中国大陆许可协议 进行许可。 可自由转载、引用,但需署名作者且注明文章出处。

共收到 7 条回复 cesium
ddchyy#14年前 1 个赞

已解决

cctomato#24年前 0 个赞

@cmccmz #1楼 请问大佬是怎么解决的?

admin#34年前 0 个赞

@cmccmz #1楼 嘿嘿,请问大佬是怎么解决的?

ddchyy#44年前 0 个赞

@admin #3楼 看了你给我的指导的链接中的内容

ranran#54年前 0 个赞

怎么解决的啊 想知道

cctomato#64年前 0 个赞

@cmccmz #4楼 请问具体怎么实现的?降版本吗?

cctomato#74年前 0 个赞

@ddchyy #1楼 大佬,请问怎么解决的啊。急求啊

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics