-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DragControls: Add rotate
mode.
#27689
Conversation
Do you mind reverting the deletion of build files? I've have tried to test out your controls with the below link but https://rawcdn.githack.com/lewibs/three.js/dev/examples/misc_controls_rotate.html
Do you mean |
Yes sorry about that. Just reverted it. It should contain the build files. I'm talking about TransformControls. |
Please make sure to not update build files at all. There should be no diff. |
The feature is actually quite nice! I wonder if it makes sense to add a separate controls class though. How about we add a new property to misc_controls_drag can be modified such that users can choose the transformation mode for better testing. |
I'm curious, what is it about it that you like? I also made a flag for the TransformControls that allows you to use it without the gizmos. It works the same way as the drag and rotate controls combined. However it doesn't change the rotation axis unfortunately it still rotates with the plane instead of about the horizon. I can make two prs if you are interested in seeing the other. Tbh I would personally recommend the remove gizmo flag for the TransformControls. The reality is that TransformControls is just made extremely well by whoever made it. The main concern I have with the flag is the rotation axis. I haven't had the time to update it when the flag is on and I'm unsure when I will. |
I just finished moving the rotation controls into the DragControls and updated the docs and the demo. I reverted back to the original build so I'm not sure why its still showing a diff. What would you recommend doing to remove these changes from the history? |
I suggest you revert all your commits in your branch (via |
Hey just finished that up. It should be good now. Let me know if there are any issues. Also let me know if modifying TransformControls to have a flag called gizmoless that would make it act like DragControls would be useful. |
Clean up.
Let's not develop |
rotate
mode.
Clean up.
Clean up.
Fix type.
Let's give this a try! |
Awesome! Thanks so much |
Description
I often use three extensions that do not work well with the TranslateControls. I as a result have been using DragControls but when I need to rotate I have been using my own variation RotateControls. I am pushing this so that perhaps others don't need to rewrite the same code.
It intentionally has extremely similar API to DragControls as well so most of this was copy pasted from that code.
The way that it works, is that when the user clicks on an object, a up vector and horizon are created. When the user moves their mouse, the object is rotated around those vectors.