|
@@ -9780,11 +9780,25 @@ class TileHeader {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(!rtcCenter) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ //rtcCenter = !rtcCenter
|
|
|
|
|
+
|
|
|
|
|
+ /* let tranM = new Matrix4$1()
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if(!rtcCenter) {
|
|
|
|
|
+ tranM.makeScale( 1,-1,1)
|
|
|
|
|
+ }else{
|
|
|
|
|
+ tranM.makeScale( 1,-1,-1)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.contentTransform.premultiply(tranM) */
|
|
|
|
|
+ if(!rtcCenter) {
|
|
|
let tranM = new Matrix4$1()
|
|
let tranM = new Matrix4$1()
|
|
|
- tranM.makeScale(1,1,-1)//大部分是这种情况. 就是因为这个变换才加的这个函数,之前bounding没考虑这个不准。不知道为什么原生的代码不用scaleZ
|
|
|
|
|
|
|
+ //tranM.makeScale( 1,-1,1)
|
|
|
|
|
+ tranM.makeScale(1, 1,-1)//大部分是这种情况. 就是因为这个变换才加的这个函数,之前bounding没考虑这个不准。不知道为什么原生的代码不用scaleZ
|
|
|
this.contentTransform.premultiply(tranM)
|
|
this.contentTransform.premultiply(tranM)
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
//如果有rtcCenter的话一开始boundingVolume不准?会不会有显示问题?
|
|
//如果有rtcCenter的话一开始boundingVolume不准?会不会有显示问题?
|
|
|
}
|
|
}
|
|
|
return this.contentTransform.clone()
|
|
return this.contentTransform.clone()
|
|
@@ -18404,10 +18418,28 @@ model.position.copy(pos)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-cesium显示:http://192.168.0.59:1234/examples/tomcat/allTest/Cesium-3dTiles/index.html
|
|
|
|
|
|
|
+cesium显示:http://192.168.0.59:1234/examples/tomcat/allTest/Cesium-3dTiles/index-sphere.html
|
|
|
tile.header.boundingVolume.sphere 应用上变换才是 tile.boundingVolume.center
|
|
tile.header.boundingVolume.sphere 应用上变换才是 tile.boundingVolume.center
|
|
|
|
|
+-.-.-.-.--.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
|
|
|
|
|
+
|
|
|
|
|
+用另一个开源代码转的是box型的,这样对准位置:
|
|
|
|
|
+let center = new THREE.Vector3().fromArray([-2361896.965580558 ,//json的transform的后面三位
|
|
|
|
|
+5407880.606769544 ,
|
|
|
|
|
+2412064.492022378
|
|
|
|
|
+])
|
|
|
|
|
+let pos = Potree.sdk.cesMath.fromCes(center)
|
|
|
|
|
+viewer.modules.MergeEditor.selected.position.copy(pos)
|
|
|
|
|
+//let lonlat = Potree.sdk.cesMath.fromCes(center,true)
|
|
|
|
|
+//let pos = viewer.transform.lonlatToLocal.forward(lonlat)
|
|
|
|
|
+
|
|
|
|
|
+//viewer.modules.MergeEditor.moveBoundCenterTo( viewer.modules.MergeEditor.selected, new THREE.Vector3().fromArray(pos) )
|
|
|
|
|
+//因为bound中心在原点所以上面两句都可以
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+viewer.modules.MergeEditor.selected.updateMatrixWorld()
|
|
|
|
|
+viewer.modules.MergeEditor.getBoundCenter(viewer.modules.MergeEditor.selected)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
==============
|
|
==============
|
|
|
|
|
|
|
|
3dtiles在四维看看和激光里摆放不同,这里的需要位移一段距离才能和四维看看一样,也就是和无transform后的点云一样。
|
|
3dtiles在四维看看和激光里摆放不同,这里的需要位移一段距离才能和四维看看一样,也就是和无transform后的点云一样。
|