godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Add trackball-style rotation for 3D gizmo (like in Blender) #7753

Open bonclide opened 1 year ago

bonclide commented 1 year ago

Describe the project you are working on

Simple first test project

Describe the problem or limitation you are having in your project

3D rotation gizmo does not have Trackball rotation (as far as I know)

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add a trackball that can be selected when rotating objects, and will rotate all axis at once, depending on where the mouse is. Like this, from blender:

Blender's Trackball for rotating

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

trackballmockup

There would be a transparent ball around the axes that can be selected, and when hovered over, it will light up, showing that you can select it. When selecting it, it will behave like a trackball, very similar to the previous example above.

If this enhancement will not be used often, can it be worked around with a few lines of script?

It could be an add-on or option in a menu, but that would hide it from people who really need it, searching through all those menus.

Is there a reason why this should be core and not an add-on in the asset library?

This will greatly improve the rotation tool and can be a real time saver, instead of doing all axes one by one. If it were an add-on, most people wouldn't even know the time they could've saved.

Calinou commented 1 year ago

This is already implemented, but you need to switch to the Rotate mode (R) and drag the mouse anywhere with a node selected, or press the rotate action shortcut (which isn't bound by default unless https://github.com/godotengine/godot/pull/78148 is merged).

Lamoot commented 1 week ago

Hello,

to clarify things, this feature is not yet implemented in Godot. What is implemented is rotating an object along the view axis. The two methods might initially look similar, but they are different and have their valid use cases.

To show the difference more clearly, here's a quick video from Blender showing the two rotation methods. Each has a different way to access it.

https://github.com/user-attachments/assets/5ca89324-f159-41ab-b340-4541565d3f35

Notice also how the mouse cursor changes, to show what kind of input is required. Trackball rotation is a very useful addition to control the orientation of a 3D object. Rather than taking axes into consideration, it allows a more freeform style of rotation. It's quite common in many 3D programs and game engines and it would fit into Godot as well.