Open JPJPJPOPOP opened 5 years ago
So I've been investigating this, and it seems to be due to a phenomenon with Euler angle rotations called Gimbal locks. When the "middle" axis is rotated exactly 90 degrees, the outer and inner axes match, and therefore trying to rotate the globe in the way demonstrated in the video is giving inputs to 2 different axes, which have opposite rotations, and therefore it rotates both ways, causing this weird behaviour.
This issue is not an issue with the Globe Viewer, but rather with d3-geo in general. Indeed, this issue is also present in many other d3 globes, including the one the Globe Viewer is based on. I suspect the reason this was never noticed is because the rotation must be exactly 90 degrees for this issue to happen, and it is almost impossible to do this using the mouse. However, due to epo's location at exactly this position, one can rotate exactly to the problematic point. To notice this issue in another globe, one has to be looking for it, but you can find it by typing proj.rotate([0,90,0])
and then refresh()
(or whatever the equivalent to these functions is for the specific globe) in the console, and the same issue will happen if you try to rotate the globe.
While a workaround could maybe be found, I will open an issue in the d3-geo repo to inform their maintainers. Here is the issue.
When you center on epo either by filtering by language or double-clicking and try rotating, the rotation is sometimes jerky. It might be because epo is located at the bottom of the globe since this bug doesn't occur for any other points.