Skip to content

Enable panning in "orbit" mode#273

Closed
mgeier wants to merge 1 commit into
widgetti:masterfrom
mgeier:orbit-panning
Closed

Enable panning in "orbit" mode#273
mgeier wants to merge 1 commit into
widgetti:masterfrom
mgeier:orbit-panning

Conversation

@mgeier

@mgeier mgeier commented Sep 24, 2019

Copy link
Copy Markdown
Contributor

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

mgeier commented Sep 24, 2019

Copy link
Copy Markdown
Contributor Author

I think this might even fix #89.

@coveralls

coveralls commented Sep 24, 2019

Copy link
Copy Markdown

Coverage Status

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

@maartenbreddels maartenbreddels left a comment

Copy link
Copy Markdown
Collaborator

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

Comment thread js/src/figure.js
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
Copy Markdown
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
Copy Markdown
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

Tronic commented Oct 22, 2019

Copy link
Copy Markdown

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

mgeier commented Oct 22, 2019

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
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
Copy Markdown
Collaborator

#280 replaces this PR

@mgeier

mgeier commented Nov 11, 2019

Copy link
Copy Markdown
Contributor Author

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