From e6dde49a9d3b8dd6c8dfdabeafe87dbd2c8c0aeb Mon Sep 17 00:00:00 2001 From: mschuetz Date: Fri, 13 Mar 2015 10:05:30 +0100 Subject: [PATCH] fix volume tool --- src/utils/VolumeTool.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/VolumeTool.js b/src/utils/VolumeTool.js index 258d7259..e0166fd7 100644 --- a/src/utils/VolumeTool.js +++ b/src/utils/VolumeTool.js @@ -98,7 +98,8 @@ Potree.VolumeTool = function(scene, camera, renderer){ }; this.volume = function(){ - return Math.abs(this.dimension.x * this.dimension.y * this.dimension.z); + return Math.abs(this.scale.x * this.scale.y * this.scale.z); + //return Math.abs(this.dimension.x * this.dimension.y * this.dimension.z); }; this.update = function(){ @@ -277,7 +278,8 @@ Potree.VolumeTool = function(scene, camera, renderer){ var wp = this.activeVolume.getWorldPosition().applyMatrix4(this.camera.matrixWorldInverse); var pp = new THREE.Vector4(wp.x, wp.y, wp.z).applyMatrix4(this.camera.projectionMatrix); var w = Math.abs((wp.z / 10)); - this.activeVolume.setDimension(w, w, w); + //this.activeVolume.setDimension(w, w, w); + this.activeVolume.scale.set(w,w,w); } }