-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Automatic alignment of ticks in 3D scenes #3131
Conversation
package.json
Outdated
@@ -78,7 +78,7 @@ | |||
"gl-mat4": "^1.2.0", | |||
"gl-mesh3d": "^2.0.0", | |||
"gl-plot2d": "^1.3.1", | |||
"gl-plot3d": "^1.5.7", | |||
"gl-plot3d": "git://github.com/gl-vis/gl-plot3d.git#240870c6cbf602b956363b86287e516a45969ea5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@archmoj interesting - The code looks great and it does exactly what we discussed, can't argue with any of that! But now that I see it and play with it, I'm actually not convinced that this is better than having each label independently restricted to [-90,90] degrees rotation as implemented in #3084. I kind of think the improved consistency from label to label is not worth the reduced legibility of individual labels. What do you think? @etpinard @antoinerg thoughts? |
|
@antoinerg when @archmoj first implemented the rotated labels I said I wished the labels for one axis would all get the same rotation, so you could read them as a series. That’s the consistency argument. Try it on master, as you slowly rotate a scene you’ll see the labels flip one at a time as each grid line passes through vertical. In this PR they all flip together. |
|
We could setup the shader to be able to serve both functionalities (as well as others e.g. option:2 for horizontal/vertical, option:8 for 8 directions ...). For example I could simply allocate option:0 (now used for debugging) for the ranges between [-90,90]. Then the question would be which option 0/1 should be the default behavior. I personally think that when either the ticks include some text or the user need to print the graph it would be nice to give them options to switch to this new behavior. |
@antoinerg |
Absolutely, a reasonable place to bring it up. I can certainly see cases where horizontal is better, and a lot of simple situations fall into this camp. But there are also cases - particularly when there are lots of ticks (so it can be ambiguous which label goes with which tick) or long labels (so they can overlap each other) - where to my eye it's much better to rotate the labels. So if we only have one behavior I think it should be this one (specifically restricting each label independently to [-90, 90] degrees) but I'd be happy for us to enable fixed angle (normally fixed at 0) and consistently rotated angles in a subsequent PR. |
package.json
Outdated
@@ -78,7 +78,7 @@ | |||
"gl-mat4": "^1.2.0", | |||
"gl-mesh3d": "^2.0.0", | |||
"gl-plot2d": "^1.3.1", | |||
"gl-plot3d": "^1.5.7", | |||
"gl-plot3d": "git://github.com/gl-vis/gl-plot3d.git#ecb766038c6c3bb041a6405795c42512c56f5387", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is actually pointing to this change on gl-axes3d:
gl-vis/gl-axes3d@master...align-ticks
OK great - I'm glad this now leaves all the mocks as they were before the PR. Since this doesn't have any immediate effect anymore, let's wait and see if @etpinard's opinion changes the result at all. |
Oh actually, I forgot, this PR includes the Chrome 51 title rotation fix, right? In that case, lets go ahead and merge the upstream PRs and this, and we can discuss whether to change the default behavior and/or add another config parameter in a separate PR. 💃 |
I'm very glad of that as well. 👍
I much prefer the behavior now. 🥇 Pro tip for @archmoj: you should delete your PR branches after merging them (I've done so here, no worries), to reduce the chance of collisions between local and origin branch names. |
This PR improves automatic alignment of ticks on 3D axes. The best single orientation for each axis (depending on the camera position and orientation) is found and used by vertex shader.
In the earlier work it was possible for the ticks on an axis to align themselves in two different directions and stay upwards. But such behavior was not completely desirable in some perspective views.
@alexcjohnson