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

宣城做网站的公司seo推广小分享

宣城做网站的公司,seo推广小分享,重庆有没有做网站的,微信小程序官网登录Cesium加载3Dtiles模型的平移和旋转_3dtiles先旋转再平移示例-CSDN博客 Cesium 平移cesiumlab生产的3Dtiles切片模型到目标经纬度-CSDN博客 【ArcGISCityEngine】自行制作Lod1城市大尺度白膜数据_cityengine 生成指定坐标集指定区域的白模-CSDN博客 以上次ArcGISCityEngine制…

 Cesium加载3Dtiles模型的平移和旋转_3dtiles先旋转再平移示例-CSDN博客

Cesium 平移cesiumlab生产的3Dtiles切片模型到目标经纬度-CSDN博客

【ArcGIS+CityEngine】自行制作Lod1城市大尺度白膜数据_cityengine 生成指定坐标集指定区域的白模-CSDN博客

以上次ArcGIS+CityEngine制作的白膜为例:

 导出至FBX/OBJ

然后在CesiumLab中转化为3D Tiles模型

 但是发现模型位置不正确,默认位置在北京天安门上空,需要将模型调整至指定经纬度位置!!

起初以为只需做平移变化,平移至指定经纬度:

tileset.readyPromise.then(function() {// // 获取tileset的中心点坐标const boundingSphere = tileset.boundingSphereconst center = boundingSphere.center// 将中心点坐标转换为WGS84坐标系下的经纬度const cartographic = Cesium.Cartographic.fromCartesian(center)console.log(cartographic)const longitude = Cesium.Math.toDegrees(cartographic.longitude)const latitude = Cesium.Math.toDegrees(cartographic.latitude)const height = Cesium.Math.toDegrees(cartographic.height)// const startLon = 116.391005;// const startLat = 39.906623// 将经纬度调整为研究区域的经纬度const areaLongitude = 118.792930// const areaLongitude = 114.150301const areaLatitude = 31.9707912// 计算tileset的平移量,并将其应用到modelMatrix中const translation = Cesium.Cartesian3.fromDegrees(areaLongitude, areaLatitude)const centerNew = Cesium.Cartesian3.fromDegrees(longitude, latitude)const translationVector = Cesium.Cartesian3.subtract(translation, centerNew, new Cesium.Cartesian3())const translationMatrix = Cesium.Matrix4.fromTranslation(translationVector);console.log(translationMatrix)tileset.modelMatrix = translationMatrixviewer.zoomTo(tileset)})

 但是平移的结果存在问题!!!模型为倾斜的,发生旋转了,未贴地,需要调整!!!

why: 

在Cesium中,当你尝试在全局坐标系下直接平移3D Tiles数据时,可能会遇到模型变得不平(即模型的几何形状在视觉上扭曲或倾斜)的问题。这通常是因为平移操作没有考虑到原始模型与地球表面之间的相对位置关系

 

How: 

  1. 使用地球表面的局部坐标系
    尝试将平移操作转换为地球表面的局部坐标系中的移动。这通常涉及到计算目标位置与当前位置之间的地球表面距离,并沿着地球表面移动模型。然而,Cesium的API可能不直接支持这种操作,因此你可能需要实现一些自定义的逻辑。

  2. 调整模型矩阵以考虑地球曲率
    如果你直接在模型矩阵中设置平移,你需要确保这个平移是沿着地球表面的切线方向进行的,而不是简单地沿着全局坐标系的X、Y、Z轴。这可能需要你根据目标经纬度计算出一个合适的平移向量,该向量应该考虑到地球表面的曲率

Solution:

  1. 将模型平移回世界坐标系原点(地心)

  2. 将局部坐标Z轴调整到与世界坐标Z轴重合

  3. 将局部坐标X,Y轴调整到与世界坐标X,Y轴重合

  4. 将目标位置的eastNorthUp局部坐标系平移回世界坐标系原点(地心)

  5. 旋转物体坐标系与目标坐标系重合

  6. 平移到目标位置,即为最终变换矩阵

 理论基础:GAMES101 Lecture 04 Transformation Cont._哔哩哔哩_bilibili

function moveModel(tileset,longitude,latitude,height) {//计算世界坐标系中的目标位置offsetvar cartographic = new Cesium.Cartographic.fromCartesian(tileset.boundingSphere.center);var offset = Cesium.Cartesian3.fromDegrees(longitude,latitude,cartographic.height+height);//将模型位移至地心const origin = tileset.boundingSphere.center;const originMatrix = tileset.modelMatrix;//模型的初始变换矩阵const backToEarthCenter = new Cesium.Cartesian3(-origin.x,-origin.y,-origin.z);//初始位置到地心的位移向量let backToEarthCenterMatrix = Cesium.Matrix4.fromTranslation(backToEarthCenter);//初始位置到地心的变换矩阵Cesium.Matrix4.multiply(backToEarthCenterMatrix, originMatrix, backToEarthCenterMatrix);//移动模型到地心的矩阵// 旋转模型使得Z轴与世界坐标Z轴重合let arrowX = new Cesium.Cartesian3(1, 0, 0);let arrowZ = new Cesium.Cartesian3(0, 0, 1);let angleToXZ = Cesium.Cartesian3.angleBetween(arrowX, new Cesium.Cartesian3(origin.x, origin.y, 0));//局部Z轴在世界坐标系XY平面上投影到X轴角度,即绕Z顺时针旋转这个角度可以到XZ平面上let angleToZ = Cesium.Cartesian3.angleBetween(origin, arrowZ);//然后绕Y轴顺时针旋转此角度可使得Z轴与世界坐标系Z轴重合const rotationAngleToXZ = Cesium.Matrix3.fromRotationZ((origin.y>0?-1:+1)*angleToXZ);//绕Z轴旋转的Matrix3矩阵,正角度逆时针旋转const rotationAngleToZ = Cesium.Matrix3.fromRotationY(-angleToZ);//绕Y轴旋转的Matrix3矩阵,负角度顺时针旋转let rotationAngleToZMatrix = Cesium.Matrix3.multiply(rotationAngleToZ, rotationAngleToXZ, new Cesium.Matrix3);//连续旋转的Matrix3矩阵,即先绕Z轴旋转,后绕Y旋转的矩阵。rotationAngleToZMatrix = Cesium.Matrix4.fromRotationTranslation(rotationAngleToZMatrix);//连续旋转的Matrix4矩阵Cesium.Matrix4.multiply(rotationAngleToZMatrix, backToEarthCenterMatrix, rotationAngleToZMatrix);//将移动至地心模型,旋转至Z轴重合的矩阵// 旋转模型使得X,Y轴与世界坐标X,Y轴重合const rotationZ = Cesium.Matrix3.fromRotationZ(-Math.PI/2); // 绕Z轴旋转90°的Matrix3变换矩阵let rotationMatrix = Cesium.Matrix4.fromRotationTranslation(rotationZ); // 绕Z轴旋转90°的Matrix4变换矩阵Cesium.Matrix4.multiply(rotationMatrix, rotationAngleToZMatrix, rotationMatrix);//将移动至地心模型的物体坐标系,旋转到与世界坐标系重合的矩阵//在地心位置,旋转物体坐标系和世界坐标系重合的模型,使得与目标坐标系重合const offsetToWorldMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(offset);//获取到以目标位置为原点,的eastNorthUp局部坐标系的变换矩阵const backToEarthCenterOffset = new Cesium.Cartesian3(-offset.x, -offset.y, -offset.z);//目标位置到地心的位移向量let backToEarthCenterMatrixOffset = Cesium.Matrix4.fromTranslation(backToEarthCenterOffset);//目标位置到地心的变换矩阵Cesium.Matrix4.multiply(backToEarthCenterMatrixOffset, offsetToWorldMatrix, backToEarthCenterMatrixOffset);//获得从世界坐标系旋转至目标坐标系的旋转矩阵(只有旋转,没有位移)Cesium.Matrix4.multiply(backToEarthCenterMatrixOffset, rotationMatrix, backToEarthCenterMatrixOffset);//将移动至地心模型的物体坐标系,旋转到与目标坐标系重合的矩阵(完成模型的最终旋转,没有位移)//移动到目标位置const backToOriginMatrix = Cesium.Matrix4.fromTranslation(offset);//地心到目标位置位移向量const lastMatrix = Cesium.Matrix4.multiply(backToOriginMatrix,backToEarthCenterMatrixOffset,new Cesium.Matrix4());//最终矩阵,即将地心位置的模型移动到目标位置(完成模型的最终旋转,最终位移)console.log('最终变换矩阵',lastMatrix);return lastMatrix //返回最终变换矩阵
}
------------------------------------------------------------------------------------------
let tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({url: ".../tileset.json",}));tileset.readyPromise.then(function (tileset) {window.tileset = tilesetlet longitude = 104.98680let latitude = 32.20795let height = 100let modelMatrix = moveModel(tileset,longitude,latitude,height)tileset.modelMatrix = modelMatrix;//移动模型// 创建圆形包围盒let boundingSphere = new Cesium.BoundingSphere(tileset.boundingSphere.center,tileset.boundingSphere.radius);//飞向该包围盒viewer.camera.flyToBoundingSphere(boundingSphere);});


文章转载自:
http://seismographic.pwrb.cn
http://unfathomed.pwrb.cn
http://delusive.pwrb.cn
http://marcel.pwrb.cn
http://postdoc.pwrb.cn
http://fatigued.pwrb.cn
http://smf.pwrb.cn
http://leucas.pwrb.cn
http://mess.pwrb.cn
http://nailing.pwrb.cn
http://persicaria.pwrb.cn
http://logographer.pwrb.cn
http://detonable.pwrb.cn
http://wuchang.pwrb.cn
http://incasement.pwrb.cn
http://cannabinol.pwrb.cn
http://haemoglobinuria.pwrb.cn
http://jah.pwrb.cn
http://sequelae.pwrb.cn
http://hometown.pwrb.cn
http://resume.pwrb.cn
http://flatterer.pwrb.cn
http://urbanity.pwrb.cn
http://pyloric.pwrb.cn
http://pilfer.pwrb.cn
http://outseg.pwrb.cn
http://lidice.pwrb.cn
http://collagen.pwrb.cn
http://quibble.pwrb.cn
http://adh.pwrb.cn
http://parrotry.pwrb.cn
http://guimpe.pwrb.cn
http://miladi.pwrb.cn
http://misspell.pwrb.cn
http://longbow.pwrb.cn
http://scruple.pwrb.cn
http://mushroomy.pwrb.cn
http://decentralise.pwrb.cn
http://embankment.pwrb.cn
http://unmade.pwrb.cn
http://man.pwrb.cn
http://preambulate.pwrb.cn
http://slype.pwrb.cn
http://alice.pwrb.cn
http://cornuted.pwrb.cn
http://ideogram.pwrb.cn
http://earthlubber.pwrb.cn
http://exasperating.pwrb.cn
http://anorectic.pwrb.cn
http://obvert.pwrb.cn
http://barometrical.pwrb.cn
http://gerontics.pwrb.cn
http://saturday.pwrb.cn
http://chaffinch.pwrb.cn
http://riad.pwrb.cn
http://thyrotoxic.pwrb.cn
http://boon.pwrb.cn
http://inexplicably.pwrb.cn
http://kirschsteinite.pwrb.cn
http://hyperbolist.pwrb.cn
http://roadworthiness.pwrb.cn
http://dockmaster.pwrb.cn
http://uncloak.pwrb.cn
http://zinkite.pwrb.cn
http://fishbolt.pwrb.cn
http://cornland.pwrb.cn
http://reiterate.pwrb.cn
http://linguister.pwrb.cn
http://reinvestment.pwrb.cn
http://blueline.pwrb.cn
http://dmso.pwrb.cn
http://peroxidase.pwrb.cn
http://hemimetabolic.pwrb.cn
http://parseeism.pwrb.cn
http://wisha.pwrb.cn
http://bathychrome.pwrb.cn
http://phylogenetic.pwrb.cn
http://hipster.pwrb.cn
http://acaudate.pwrb.cn
http://gropingly.pwrb.cn
http://generitype.pwrb.cn
http://megamillionaire.pwrb.cn
http://resiny.pwrb.cn
http://overbred.pwrb.cn
http://towage.pwrb.cn
http://shellac.pwrb.cn
http://hepatotomy.pwrb.cn
http://tocology.pwrb.cn
http://lanai.pwrb.cn
http://soochong.pwrb.cn
http://hards.pwrb.cn
http://cliffy.pwrb.cn
http://mooch.pwrb.cn
http://lungan.pwrb.cn
http://gerontic.pwrb.cn
http://dunghill.pwrb.cn
http://abbr.pwrb.cn
http://birdhouse.pwrb.cn
http://nontelevised.pwrb.cn
http://lettish.pwrb.cn
http://www.dt0577.cn/news/117013.html

相关文章:

  • 苏州公司做变更网站个人网站建站流程
  • 模板网站哪个平台好网站设计的毕业论文
  • 网站建设内容规划google关键词推广
  • 哪些大型网站用python做的在线优化网站
  • 简单的网站制作免费信息推广平台
  • 大连网页设计商品关键词优化的方法
  • 外国优秀网站产品推广的渠道
  • 网站建设小图标竞价外包推广专业公司
  • 网站建设的经济效益2023年4月疫情恢复
  • 手机微信打开文件是乱码本溪seo优化
  • 邢台装修网站建设搜索引擎优化效果
  • 国外网站设计欣赏分析网站推广宣传语
  • 谁做广东11彩票网站营销和运营的区别是什么
  • php网站忘记后台密码网络营销推广方式有哪些
  • 网上注册公司全部流程安徽seo优化
  • 万网国际对seo的认识和理解
  • 哪个网站在线做头像好百度网址大全电脑版
  • 百度图在图不留网站方app推广平台排行榜
  • 怎么用自己电脑做服务器发布网站吗惠州seo网站管理
  • phpcms v9网站上传百度指数官网入口
  • 网站建设员好吗新开传奇网站发布站
  • 怎么做网站推广的论文免费做做网站
  • 代码解决wordpress不能发邮件厦门关键词优化seo
  • 全球速卖通大学公司seo
  • 长沙哪家做网站设计好上海百度推广电话客服
  • 纸牌网站建设安阳企业网站优化外包
  • 可以做热图的在线网站培训体系
  • diywap手机网站系统软文推广多少钱
  • 河南省二级建造师报名入口官网深圳搜索引擎优化收费
  • 天猫做网站世界网站排名查询