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

Enable panning in "orbit" mode #273

Closed
wants to merge 1 commit into from
Closed

Conversation

mgeier
Copy link
Contributor

@mgeier mgeier commented Sep 24, 2019

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.

@mgeier
Copy link
Contributor Author

mgeier commented Sep 24, 2019

I think this might even fix #89.

@coveralls
Copy link

coveralls commented Sep 24, 2019

Coverage Status

Coverage decreased (-0.01%) to 66.196% when pulling d3bce32 on mgeier:orbit-panning into fbd1ba0 on maartenbreddels:master.

Copy link
Collaborator

@maartenbreddels maartenbreddels left a 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:
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@Tronic
Copy link

Tronic commented Oct 22, 2019

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.

@mgeier
Copy link
Contributor Author

mgeier commented Oct 22, 2019

@Tronic I was also using pythreejs in the meantime and made the same observation.

I guess when ipyvolume was developed, pythreejs didn't yet have those features?

@maartenbreddels Are there plans to re-write some of ipyvolume using those new pythreejs features?

@maartenbreddels
Copy link
Collaborator

I guess when ipyvolume was developed, pythreejs didn't yet have those features?

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.

@maartenbreddels
Copy link
Collaborator

#280 replaces this PR

@mgeier
Copy link
Contributor Author

mgeier commented Nov 11, 2019

If I'm understanding this correctly, #280 isn't actually a replacement for this PR, see #280 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants