-
Notifications
You must be signed in to change notification settings - Fork 29
Allow rotating ortho view #8614
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
Conversation
Note Reviews pausedUse the following commands to manage reviews:
📝 WalkthroughWalkthroughThis update introduces free rotation in orthogonal viewports, refactoring core 3D transformation logic, UI, and state management to support arbitrary camera orientation in orthogonal mode. It adds rotation-aware shaders, disables incompatible tools when rotated, exposes rotation controls in the UI, and updates tests and reducers for consistent rotation handling throughout the application. Changes
Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Possibly related PRs
Suggested reviewers
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…ho-view-rotation-v2
…alculate correct global position in shader
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.
Thanks for all the feedback. Here are my answers.
I'll ask for the next review hopefully soon. I just noticed that the line measurement tool does not work for datasets with anisotropic voxel scale. At least scale [1,1,1]
works but the normal l4_sample voxel scale does not.
frontend/javascripts/viewer/controller/viewmodes/plane_controller.tsx
Outdated
Show resolved
Hide resolved
frontend/javascripts/viewer/geometries/materials/plane_material_factory.ts
Outdated
Show resolved
Hide resolved
frontend/javascripts/viewer/view/action-bar/dataset_rotation_popover_view.tsx
Outdated
Show resolved
Hide resolved
frontend/javascripts/viewer/geometries/materials/plane_material_factory.ts
Outdated
Show resolved
Hide resolved
…lt back with calculateInViewportPos
…ho-view-rotation-v2
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.
Ok, I fixed the line measurement tool for anisotropic datasets while they are viewed with rotation.
The bug was due to not correctly calcuating a global position back into the screen viewport space to check whether the user moved the viewport back / forth to hide the tooltip. Now the calculation is correct. I also added tests for the calculation of global positions which I used for debugging this. My initial understanding that the calculation of a global position from an event was wrong. I still kept the tests as they seemed useful to me.
Sooooo now that this is done, I'd say this ready for another review round and of cause a testing session :D
frontend/javascripts/viewer/model/accessors/view_mode_accessor.ts
Outdated
Show resolved
Hide resolved
frontend/javascripts/test/model/accessors/flycam_accessors.spec.ts
Outdated
Show resolved
Hide resolved
frontend/javascripts/test/model/accessors/view_mode_accessors.spec.ts
Outdated
Show resolved
Hide resolved
Oh and a frontend test seems to timeout consistently. I'll take a look at this but this should not block your review |
@philippotto in my latest commit I "fixed" a test by removing a take statement. I am honestly confused why this is suddenly necessarry. Do you maybe have an idea? on master, working:
on this branch
|
@philippotto FYI: The new assertion that the active tool is still the proofreading tool after the test I fixed on this branch is working on this branch and failing on the master. On master the active tool indeed switches back to the the move tool.
So the fix of removing the take statement should indeed be correct |
…ptimization code in the vertex shader are handled correctly
testing went mostly well 🎉 however, I found one bug:
|
- done by introducing new action translating the flycam absolute without any rotation / zoom etc. interference
…ho-view-rotation-v2
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.
Thanks a lot for the thorough review @philippotto.
And thanks for finding this bug. I did know that alt + scroll is a feature.
Please give it another try. I just pushed the fix (see commit 01bbc9a). The fix includes a new flycam action for which I also added tests. I needed the new flycam action as the part of the zoom to mouse position was to modify the position of the flycam with an absolute translation that ignored the current rotation of the flycam and scaling / zoom value and so on. No action does this.
Of cause: I could also have used the setPosition action and handed it the flycamPos
+ offset. If you prefer this, please just tell me, but I don't really see the benefit for this except maybe no new action.
Once the CI is done, I'll redeploy for easier testing
@@ -93,7 +95,7 @@ function getMousePosition() { | |||
return calculateGlobalPos(state, { | |||
x: mousePosition[0], | |||
y: mousePosition[1], | |||
}).rounded; | |||
}).floating; |
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 figured this might be a little better to have a bit more accuracy.
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.
this is only used for the zoom to mouse position
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.
Awesome stuff! thanks for pulling this to the finish line 🥇
Co-authored-by: Philipp Otto <philippotto@users.noreply.github.com>
Documentation about rotation & 3d scene
https://www.notion.so/scalableminds/3D-Rotations-3D-Scene-210b51644c6380c2a4a6f5f3c069738a
This documentation explains the quirky of how rotations are handled in more details.
URL of deployed dev instance (used for testing):
Steps to test:
Review the docs file above
UI
Keyboard shortcuts:
Tools
3D viewport
Tabs
Arbitrary view
And of cause: Other things you thing might be broken by this PR
URL / Links
TODOs:
adapt bucket picking (reuse picker for arbitrary mode)The URL zoom state is increasing with every created skeleton node xDdynamicSpaceDirection
setting while rotation is activeits kinda fixed but the pattern does not rotate correctly with the data leading to unexpected "pattern moving" while rotating[0, 0, 0]
getUnrotatedWorldCoordUVW
#3598,3476,994,0,0.933,30,0,0,50
there can be a "black row"ctrl + alt + left
andctrl + alt + right
keyboard shortcut for 90° rotation. Doesn't work on my system as it is a window manager reserved shortcut.Issues:
(Please delete unneeded items, merge only when none are left open)