-
Notifications
You must be signed in to change notification settings - Fork 234
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
Enable panning in "orbit" mode #273
Conversation
I think this might even fix #89. |
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.
The camera part in ipyvolume is really tricky and brittle, but I'm getting convinced this is an improvement.
Just a small question
@@ -634,7 +627,10 @@ var FigureView = widgets.DOMWidgetView.extend({ | |||
this.control_orbit = new THREE.OrbitControls(this.camera, this.renderer.domElement); | |||
this.control_trackball.dynamicDampingFactor = 1. | |||
this.control_trackball.noPan = true; | |||
this.control_orbit.enablePan = false; | |||
// All widgets on the page would receive those keypresses all the time: |
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.
I am not sure what you mean by this comment.
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.
I just wanted to explain why enableKeys
is switched off:
The problem is that if there are multiple ipyvolume
widgets on the same page and I press, e.g., the left arrow key, all of them pan to the left. Which is most likely not the expected behavior.
But I can simply remove the comment if it causes confusion.
... or replace it by whatever you prefer. Just tell me.
I recently rewrote my vis code straight for pythreejs largely because of camera handling and found out that OrbitControls just work perfectly, even for panning, with no tweaks required. Hopefully this helps. |
@Tronic I was also using I guess when @maartenbreddels Are there plans to re-write some of |
Yes, and we didn't know how to hook it up, it is possible now, and I'm thinking of leaning more on pythreejs indeed. |
#280 replaces this PR |
If I'm understanding this correctly, #280 isn't actually a replacement for this PR, see #280 (comment). |
To select "orbit" mode, click the "up arrow" symbol in the widget.
Panning works with the right mouse button.
Panning with the arrow keys on the keyboard is still disabled (which I think was the reason to disable panning in the first place).
I had to remove some
lookAt()
calls, but I don't see any change in the behavior of the "trackball" mode because of this. Did I miss something?This is a (less intrusive) subset of #272.