Skip to content
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

Improve rotation gizmo #42094

Merged
merged 1 commit into from
Sep 28, 2020
Merged

Conversation

JFonS
Copy link
Contributor

@JFonS JFonS commented Sep 15, 2020

Hide the back sides of the rotation gizmo circles and add a white outline for better visualization of the rotation "sphere".

After trying various options, I settled with this one:

rotation_final

Video: https://streamable.com/949yyx

I think it looks the cleanest and does the job pretty well. I discarded the possibility of using the white circle to rotate around the view axis because it caused problems when overlapping with the other circles, and there is already a tool that allows for view-space rotation.

Supersedes #41765

Hide the back sides of the rotation gizmo circles and add a white
outline for better visualization of the rotation "sphere".
@JFonS JFonS added this to the 4.0 milestone Sep 15, 2020
@groud
Copy link
Member

groud commented Sep 15, 2020

It looks very good!

I wonder about something though, did you remove the bias making the circle full even if you were close the to be axis-aligned? It looks like it's not here anymore in the video. If so, it would be better to add it again IMHO.

@capnm
Copy link
Contributor

capnm commented Sep 16, 2020

I've tested that on the 3.2 branch, looks fine (GLES3 or GLES2) 👍

rot-gizmo

blender 2.90 <-> godot 3.2.3+

rot-gizmo2

@JFonS
Copy link
Contributor Author

JFonS commented Sep 17, 2020

@groud I think it looks better without the bias now that we have the white circle.

Here is the video with a tiny amount of bias: https://streamable.com/o6fkrg

And this version with slightly more bias: https://streamable.com/714hwt

The cool thing about the white circle is that it connects the ending points of the other circles and it "closes" the sphere, if we add bias we lose this and I find it more distracting, but I am not completely against bias.

@groud
Copy link
Member

groud commented Sep 17, 2020

The problem is that this in not really supposed to be a visual change only (reading the code it is for now), but the places where you would be able to start dragging the rotation tool should be the ones which are visible. Otherwise this might be confusing and people might try to drag a circle which is not visible. Even if on hover the selected circle appears, having the circle appearing while you try to select something else is not good.

If we keep this as a visual change for now (we can implement it in two steps, I don't think it's a problem), I'm ok keeping the no-bias version. But if as soon as we improve the input to consider only the visible part (which I believe we should), I truly think the bias should be added back, so that the full circle can be used to rotate the object when being almost along an axis.

@JFonS
Copy link
Contributor Author

JFonS commented Sep 17, 2020

It's not just a visual change... You can only hover and click the visible parts of the circles.

I want to improve this code at some point because when the size of the "clickable" area depends on the viewing angle and in some cases it becomes very small, but that's a separate issue.

About this PR, when the axis is facing the camera you always have about half the circle visible, so that should give plenty of space to click it. All the other 3D softwares I looked at do something similar, without bias.

@groud
Copy link
Member

groud commented Sep 17, 2020

It's not just a visual change... You can only hover and click the visible parts of the circles.

Ah in such case I believe the a little bit of bias would be better. Thing is that, in some cases, people might want to visually align the rotation with another object in background or something like that. So Ii would allow them to select the circle wherever they want when they are close to the axis.

@JFonS
Copy link
Contributor Author

JFonS commented Sep 17, 2020

I'm still not sold on adding the bias... can we merge this PR as-is and add the bias in another PR if we really see it's needed? I tried many versions of the gizmo and the one I PR'd is the one I felt was clearer and easier to use.

With the bias you can get this situation:
Screenshot from 2020-09-17 19-15-40
Which kills the perspective a bit because the white and the blue circle are very similar but not quite the same and it makes it harder to read.

@groud
Copy link
Member

groud commented Sep 17, 2020

I'd like to have more opinions on it though.

@groud
Copy link
Member

groud commented Sep 17, 2020

Actually in blender, they do have a little bit a of bias:
2020-09-17 20-06-41

Edit: changed to a gif

@JFonS
Copy link
Contributor Author

JFonS commented Sep 17, 2020

Yes, in order to have the full circle when you are exactly aligned with the axis (i.e. when using the orthogonal top/side/front views).

My PR already includes this, but I wouldn't make it much more biased because then you get the double circles. With a tiny amount of bias it just overlaps the white circle and it looks okay.

@groud
Copy link
Member

groud commented Sep 17, 2020

My PR already includes this, but I wouldn't make it much more biased because then you get the double circles. With a tiny amount of bias it just overlaps the white circle and it looks okay.

Ah ok, I though there was no bias at all and that you had to be perfectly aligned. In such case it's ok.

@capnm
Copy link
Contributor

capnm commented Sep 17, 2020

I've been using this PR for a few days in our 'production' version ^^.
I tend to agree with ground's comments. It looks good when you hover over the circle.
Unselected it is still clearly visible, but subjectively I perceive it to be too colorless.

Another technical difference is that it takes some time to compile the shader,
which delays the first appearance after you click in the 3d view first time.

Either way, I think it's a huge improvement and the issues could be solved in another PRs.
(Blender has a white circle around, another good feature, you can also rotate the 'virtual' sphere.)

@akien-mga akien-mga merged commit b2e07dd into godotengine:master Sep 28, 2020
@akien-mga
Copy link
Member

Thanks!

@mbrlabs
Copy link
Contributor

mbrlabs commented Oct 15, 2020

@JFonS That's a massive usability improvment! Is there any reason not to backport this to 3.2? @capnm seems to already use it in production just fine.

@JFonS JFonS deleted the rotation_gizmo_improvements branch May 4, 2021 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants