|
|
@@ -23,6 +23,8 @@ const CloneJson = function (data) {
|
|
|
return JSON.parse(str);
|
|
|
};
|
|
|
|
|
|
+const needRot90 = true
|
|
|
+
|
|
|
var enter = ({
|
|
|
dom,
|
|
|
mapDom,
|
|
|
@@ -77,30 +79,7 @@ var enter = ({
|
|
|
|
|
|
Potree.start(dom, mapDom, number);
|
|
|
|
|
|
- if(isTemp){
|
|
|
-
|
|
|
- viewer.addEventListener('allLoaded',()=>{
|
|
|
-
|
|
|
- //Potree.settings.cloudAttributeName = 'color'
|
|
|
- //viewer.scene.pointclouds[0].material.activeAttributeName = 'color'
|
|
|
- //pointcloud.material.color = '#ffffff'
|
|
|
- //viewer.scene.pointclouds[0].material.pointSizeType = 'FIXED'
|
|
|
-
|
|
|
- //旋转九十度
|
|
|
- let pointcloud = viewer.scene.pointclouds[0]
|
|
|
- pointcloud.orientationUser = new THREE.Quaternion().setFromEuler(new THREE.Euler( Math.PI/2, 0,0))
|
|
|
- pointcloud.rotateMatrix = new THREE.Matrix4().makeRotationFromQuaternion(pointcloud.orientationUser)
|
|
|
-
|
|
|
- pointcloud.transformMatrix = pointcloud.rotateMatrix.clone();//为该数据集的变化矩阵。 对应navvis的m2w_
|
|
|
- pointcloud.transformInvMatrix.copy(pointcloud.transformMatrix).invert()
|
|
|
-
|
|
|
- var pos1Matrix = new THREE.Matrix4().setPosition(pointcloud.position);//先移动到点云本身应该在的初始位置(在4dkk里和其他应用中都是在这个位置的,也能和漫游点对应上)
|
|
|
- pointcloud.matrix = new THREE.Matrix4().multiplyMatrices(pointcloud.transformMatrix, pos1Matrix);
|
|
|
- pointcloud.updateMatrixWorld(true)
|
|
|
- viewer.boundNeedUpdate = true
|
|
|
- })
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
parameter.dom = dom;
|
|
|
parameter.number = number;
|
|
|
@@ -121,6 +100,32 @@ var enter = ({
|
|
|
viewer.addEventListener("allLoaded", (e) => {
|
|
|
//全部加载完,除了地图
|
|
|
console.log('emit allLoad')
|
|
|
+
|
|
|
+ if(isTemp){
|
|
|
+ //Potree.settings.cloudAttributeName = 'color'
|
|
|
+ //viewer.scene.pointclouds[0].material.activeAttributeName = 'color'
|
|
|
+ //pointcloud.material.color = '#ffffff'
|
|
|
+ //viewer.scene.pointclouds[0].material.pointSizeType = 'FIXED'
|
|
|
+
|
|
|
+ if(needRot90){
|
|
|
+ //旋转九十度
|
|
|
+ let pointcloud = viewer.scene.pointclouds[0]
|
|
|
+ pointcloud.orientationUser = new THREE.Quaternion().setFromEuler(new THREE.Euler( Math.PI/2, 0,0))
|
|
|
+ pointcloud.rotateMatrix = new THREE.Matrix4().makeRotationFromQuaternion(pointcloud.orientationUser)
|
|
|
+
|
|
|
+ pointcloud.transformMatrix = pointcloud.rotateMatrix.clone();//为该数据集的变化矩阵。 对应navvis的m2w_
|
|
|
+ pointcloud.transformInvMatrix.copy(pointcloud.transformMatrix).invert()
|
|
|
+
|
|
|
+ var pos1Matrix = new THREE.Matrix4().setPosition(pointcloud.position);//先移动到点云本身应该在的初始位置(在4dkk里和其他应用中都是在这个位置的,也能和漫游点对应上)
|
|
|
+ pointcloud.matrix = new THREE.Matrix4().multiplyMatrices(pointcloud.transformMatrix, pos1Matrix);
|
|
|
+ pointcloud.updateMatrixWorld(true)
|
|
|
+ viewer.updateModelBound()//viewer.boundNeedUpdate = true //范围还没旋转
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
sceneBus.emit("allLoaded");
|
|
|
});
|
|
|
viewer.addEventListener("webglError", (e) => {
|