diff --git a/TODO.txt b/TODO.txt deleted file mode 100644 index f1fb6d03..00000000 --- a/TODO.txt +++ /dev/null @@ -1,8 +0,0 @@ -TODO orthographic cameras: - -- (weights for node refinement for large pointclouds) - -TODO clipping: - -- polygon clipping / clip planes / measurement volumes - - EDL renderer: no depth of volumes stored -> no depth test possible diff --git a/src/utils/ClipVolume.js b/src/utils/ClipVolume.js index 9cd52db7..16209b61 100644 --- a/src/utils/ClipVolume.js +++ b/src/utils/ClipVolume.js @@ -8,9 +8,6 @@ Potree.ClipVolume = class extends THREE.Object3D{ this.constructor.counter = (this.constructor.counter === undefined) ? 0 : this.constructor.counter + 1; this.name = "clip_volume_" + this.constructor.counter; - this.clipOffset = 0.001; - this.clipRotOffset = 1; - let alpha = args.alpha || 0; let beta = args.beta || 0; let gamma = args.gamma || 0; @@ -18,6 +15,9 @@ Potree.ClipVolume = class extends THREE.Object3D{ this.rotation.x = alpha; this.rotation.y = beta; this.rotation.z = gamma; + + this.clipOffset = 0.001; + this.clipRotOffset = 1; let boxGeometry = new THREE.BoxGeometry(1, 1, 1); boxGeometry.computeBoundingBox(); @@ -230,11 +230,11 @@ Potree.ClipVolume = class extends THREE.Object3D{ if(cs == "local") { if(axis == "x") { - this.rotateOnAxis(this.localX, dir * this.clipRotOffset * Math.PI/180); + this.rotateOnAxis(new THREE.Vector3(1, 0, 0), dir * this.clipRotOffset * Math.PI/180); } else if(axis == "y") { - this.rotateOnAxis(this.localY, dir * this.clipRotOffset * Math.PI/180); + this.rotateOnAxis(new THREE.Vector3(0, 1, 0), dir * this.clipRotOffset * Math.PI/180); } else if(axis == "z") { - this.rotateOnAxis(this.localZ, dir * this.clipRotOffset * Math.PI/180); + this.rotateOnAxis(new THREE.Vector3(0, 0, 1), dir * this.clipRotOffset * Math.PI/180); } } else if(cs == "global") { let rotaxis = new THREE.Vector4(1, 0, 0, 0); @@ -250,6 +250,8 @@ Potree.ClipVolume = class extends THREE.Object3D{ this.rotateOnAxis(rotaxis, dir * this.clipRotOffset * Math.PI/180); } + this.updateLocalSystem(); + this.dispatchEvent({"type": "clip_volume_changed", "viewer": viewer, "volume": this}); } diff --git a/src/viewer/sidebar.js b/src/viewer/sidebar.js index 82053e3d..4d0f52b2 100644 --- a/src/viewer/sidebar.js +++ b/src/viewer/sidebar.js @@ -111,13 +111,6 @@ function initToolbar(){ } )); - // CLIP VOLUME - /*elToolbar.append(createToolIcon( - Potree.resourcePath + "/icons/clip_volume.svg", - "[title]tt.clip_volume", - function(){viewer.volumeTool.startInsertion({clip: true})} - ));*/ - // REMOVE ALL elToolbar.append(createToolIcon( Potree.resourcePath + "/icons/reset_tools.svg",