Title: [ENH]: Natural 3D rotation with mouse · Issue #28288 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: Natural 3D rotation with mouse · Issue #28288 · matplotlib/matplotlib
X Title: [ENH]: Natural 3D rotation with mouse · Issue #28288 · matplotlib/matplotlib
Description: Problem In mplot3d, the plot currently reacts differently to dragging the mouse, depending on the orientation of the axes. In the default orientation, moving the mouse left/right or up/down tilts the plot left/right or up/down correspond...
Open Graph Description: Problem In mplot3d, the plot currently reacts differently to dragging the mouse, depending on the orientation of the axes. In the default orientation, moving the mouse left/right or up/down tilts t...
X Description: Problem In mplot3d, the plot currently reacts differently to dragging the mouse, depending on the orientation of the axes. In the default orientation, moving the mouse left/right or up/down tilts t...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/28288
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: Natural 3D rotation with mouse","articleBody":"### Problem\n\nIn mplot3d, the plot currently reacts differently to dragging the mouse, depending on the orientation of the axes. In the default orientation, moving the mouse left/right or up/down tilts the plot left/right or up/down correspondingly, which is quite natural and intuitive. However, when the plot is rotated so that we are looking down the z-axis, then moving the mouse up/down does not tilt the plot up/down as expected, but rotates it around the z-axis. The situation reminds of gimball lock. It is clumsy and annoying.\r\nAdditionally, the 'roll' angle currently cannot be controlled with the mouse (issue #14451 and PR #21426 mention this) - at present, the two degrees of freedom of the mouse (left-right and up-down) correspond directly to two of the rotational degrees of freedom of the plot (azimuth and elevation), whereas there are in fact three (i.e., azimuth, elevation, and roll; or heading, tilt, and bank, if you will). Rotations around three cartesian axes do look essentially different (one can turn up/down, turn left/right, or twist left/right-handed). Controlling only two limits the accessible orientations.\n\n### Proposed solution\n\nFor a natural interaction with the mouse, it is desirable that the figure reacts in the same way to mouse movements, regardless of orientation: there should be no difference between \"poles\" and \"equator\" of the figure, and no 'gimbal lock'.\r\nOf course this problem is not new - satisfying solutions have been devised in the nineties of the last century, e.g., Ken Shoemake's 'arcball' [1]. All that is needed to implement this in `mplot3d` is a small change to `axes3d._onmove()`, together with a minimal quaternion class - this avoids an additional dependency on a large package like `numpy-quaternion`.\r\nThe quaternion class can be made internal, to hide it; or it can be exposed since it can be more generally useful.\r\n\r\n1. [Ken Shoemake, \"ARCBALL: A user interface for specifying three-dimensional rotation using a mouse.\" in Proceedings of Graphics Interface '92, 1992, pp. 151-156, [https://doi.org/10.20380/GI1992.18](https://doi.org/10.20380/GI1992.18)]\r\n\r\n","author":{"url":"https://github.com/MischaMegens2","@type":"Person","name":"MischaMegens2"},"datePublished":"2024-05-23T18:33:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/28288/matplotlib/issues/28288"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1d31ae11-bd19-bc19-1c6e-ada3d662427b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 856A:3E37F3:F36B95:140F3B9:6A519CCD |
| html-safe-nonce | 6d82929202b87656dd87a9e12e65e306c77a4b28ef4e92103d266ebcc6eedec4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTZBOjNFMzdGMzpGMzZCOTU6MTQwRjNCOTo2QTUxOUNDRCIsInZpc2l0b3JfaWQiOiI3OTUwODIyNTA0OTkzNDk2MjY5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c429fa8d51cdba18ffa3d04ac13c30aa2ab403d8f4189fec34b5252023f60f43 |
| hovercard-subject-tag | issue:2313591324 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/28288/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ef4737812c07819dfadc3a9c696060c350e03cdd891ebc8bd2b2df5e2d435ae4/matplotlib/matplotlib/issues/28288 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ef4737812c07819dfadc3a9c696060c350e03cdd891ebc8bd2b2df5e2d435ae4/matplotlib/matplotlib/issues/28288 |
| og:image:alt | Problem In mplot3d, the plot currently reacts differently to dragging the mouse, depending on the orientation of the axes. In the default orientation, moving the mouse left/right or up/down tilts t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MischaMegens2 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width