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

Support rotating the layouts #359

Open
fedarko opened this issue Aug 29, 2020 · 3 comments
Open

Support rotating the layouts #359

fedarko opened this issue Aug 29, 2020 · 3 comments

Comments

@fedarko
Copy link
Collaborator

fedarko commented Aug 29, 2020

Brought up by @kwcantrell in kwcantrell#49 (comment) and kwcantrell#49 (comment).

This would be really nice for the rectangular layout (since it'd let users draw the tree going from top to bottom, which is a common way of representing them) and for the circular layout (if the user wants the "start point" of the circle to be at an angle other than 0 radians).

This might break the "maximum displacement" computations for rectangular barplots a bit, but fixing it probably won't be too bad. (It might be easier to just support increments of 90 degrees for the rectangular layouts; not sure right now.)

@kwcantrell
Copy link
Collaborator

kwcantrell commented Aug 29, 2020

Actually, we would not need to modify anything. The rotation will be done in the shades so as far as empress is concerned, the tree will not actually change.

To rotate, all we have to do is multiply the world matrix by a rotation matrix. (The world matrix is currently responsible to zooming/moving the tree)

@fedarko
Copy link
Collaborator Author

fedarko commented Aug 29, 2020

Oh wow. That makes life even easier! So this would automatically rotate the barplots buffer, as well?

@kwcantrell
Copy link
Collaborator

kwcantrell commented Aug 29, 2020

Yupe, it will rotate everything! On top of that, it is a "free operation" in the sense that no extra computation resources are needed. WebGl will be doing the same amount of work whether or not the tree is rotated. The "cost" of rotating the tree is simply a single 4x4 matrix multiplication.

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

No branches or pull requests

2 participants