three.js: there are multiple problems with TransformControls

The effect of scaling is not independent of scene / object dimensions. I had to change these lines to

                        if ( scope.axis === "X" ) scope.object.scale.x = oldScale.x * ( 1 + 0.01 * point.x / oldScale.x );
                        if ( scope.axis === "Y" ) scope.object.scale.y = oldScale.y * ( 1 + 0.01 * point.y / oldScale.y );
                        if ( scope.axis === "Z" ) scope.object.scale.z = oldScale.z * ( 1 + 0.01 * point.z / oldScale.z );

to get sane scaling sensitivity in my project quickly.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 23 (21 by maintainers)

Commits related to this issue

Most upvoted comments

Sorry @makc I haven’t done anything with three.js in a long time although I would really love to work on it again.

@sandromartis world space scale is not really possible without another transformation matrix. I would suggest to parent the object you want to scale to an empty Object3D, and scale that instead. If you look at how Maya handles it, scaling in world space doesn’t modify object’s scale attribute. Instead, it modifies vertex positions in world space. It essentially bakes transformation into geometry and that’s not something you cant reset/undo to neutral scale.

This issue is fixed in alternate version of TransformControls But as mentioned in #7947 this fix depends on somewhat modular approach to making big and complex scene manipulation tools.

I hope to revisit this project in near future but I don’t see the clear path towards contributing fixes back into threejs. I could manually combine all the dependencies into single monolithic TransformControls.js once I get to it.

On the bright side, next fork of that fiddle will be 1337