correct scale calculation
This commit is contained in:
parent
1bd4964635
commit
1cdfcab55f
2 changed files with 6 additions and 5 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue