I wish there was an easy way to prevent users from moving an object about a particular axis. For example, it would be nice to say
var controls = new THREE.TransformControls(camera, domElement);
controls.disableAxis('x');
Then the transformControls would have draggable arrows pointing in the Y and Z directions, but not the X direction. Thanks for your consideration!
TransformControls are not maintained in this repo - last time I asked to fix the bug in it, I was told by the author that he can't do that, because his original TransformControls evolved far beyond three.js version: #9312
It does look like @arodic has done a lot with the transform controls for ree.js, but also contributors here have made relatively recent contributions to the transform controls (including @mrdoob late last year), so I don't think it's fair to say that the transform controls aren't maintained in this repo. Also note that the issue you created is still open - my guess is that if it was not related to this project it would have been closed already.
If people think this feature is a good idea, I would be happy to take a stab at it myself, although I am a little bit intimidated by the sheer size of the file...
@brmscheiner I have a split version of the TransformControl in my nunuStudio repository and i have worked on them a bit already, i might be able to take a look at this on the weekend, it should be fairly easy to do this 馃憤
I used to have similar ones that i wrote that are very simple and easy to change (https://github.com/tentone/nunuStudio/tree/0fb60a9cc7a0c3d07d90bf7cb644054831b79c0f/editor/tools) but the ones made by arodic are a lot better.
although I am a little bit intimidated by the sheer size of the file...
I believe this is what may have deterred the original author to keep working on this.
@tentone nunuStudio is a very cool project! If you do get the chance to take a look I would be massively appreciative, if not just let me know.
Hi @tentone, any chance to look into this?
Hi @brmscheiner sorry i still haven't got a change to take a look at this but as soon as i can i will work on it (i also need this for my project).
Sorry for the delay!
Dope, no problem!
Hey @tentone just wanted to circle back again :)
I would also like to see this feature, I hacked something similar quickly for a project I am currentyl working on (by giving the contstructor an array with axis and only creating the handles for these active axis in the original TransformControl).
I could work on it a bit more and create a pull request, but because @makc wrote that it is not maintained here I don't know how to proceed.
This issue should be reopened since apparently there is still need to manually disable axes. Requested by @ieskudero
Since TransformControls use string filtering for axes internally, I think it makes sense to implement disabling mechanism via strings as well. For example default property could be enabledAxes = 'XYZE
. If you change it to XZ
, it would hide all axes which include strings not included in the filter, in this case Y
, E
, XY
and YZ
Great idea, although it may be confusing for users to see an E axis :).
Either way. should there be different properties for rotation, traslation and scale? I prefer only one property for all, cleaner solution I guess, but I don麓t know what people should want.
it may be confusing for users to see an E axis
I know it's not standard nomenclature :) internally, that is how I label view/eye fixed handles. I also considered V (view) and W (comes after Z) but both felt eaqualy ambiguous.
This is done now. See c9e577e
Is this feature already added? The ShowX, ShowY, ShowZ feature only hides the handles and one can still move the object by clicking on the invisible axes.
one can still move the object by clicking on the invisible axes
lol 馃槀 it is true
Shhh! It was a secret! 馃か馃榿
lol :) I can take care of this if nobody else has a fix already.
The problem was introduced after 4ce5ba2 that changed how Raycaster works. After that change, it started including invisible objects in the gizmo.
A PR with the fix has been submitted.
Most helpful comment
This is done now. See c9e577e