diff --git a/src/mesh/api.js b/src/mesh/api.js index 57320f62..29011ae8 100644 --- a/src/mesh/api.js +++ b/src/mesh/api.js @@ -139,7 +139,7 @@ let selection = { scale(dx = 0, dy = 0, dz = 0) { for (let s of selected) { let { x, y, z } = s.scale(); - s.scale(x + dx, y + dy, z + dz); + s.scale(x * dx, y * dy, z * dz); } return selection; }, @@ -423,9 +423,11 @@ let util = mesh.util = { if (!cached || cached.bkey !== bkey) { let position = geometry.attributes.position.clone(); position.applyMatrix4(new THREE.Matrix4().extractRotation(matrix)); - cached = boundsCache[object.id] = { bkey, - bounds: new THREE.Box3().setFromBufferAttribute(position) - }; + let bounds = new THREE.Box3().setFromBufferAttribute(position); + // let scale = new THREE.Vector3().setFromMatrixScale(matrix); + // bounds.min.multiply(scale); + // bounds.max.multiply(scale); + cached = boundsCache[object.id] = { bkey, bounds }; } let bt = cached.bounds.clone(); let m4 = new THREE.Matrix4(); diff --git a/src/mesh/object.js b/src/mesh/object.js index 97f7447d..9ba60b85 100644 --- a/src/mesh/object.js +++ b/src/mesh/object.js @@ -96,7 +96,6 @@ mesh.object = class MeshObject { } scale.set(...arguments); this.matrixChanged(); - let [ x, y, z ] = arguments; } rotate(x = 0, y = 0, z = 0) {