-
Notifications
You must be signed in to change notification settings - Fork 47
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
3D Non-Orthogonal Clipping Planes #418
Conversation
Just discovered https://math.gl/modules/culling/docs/api-reference/plane so going to try switching to that. Sorry for the change. |
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.
Cool! Do you have a working demo?
How does the exposed API clippingPlanes
+ numPlanes
interact/conflict with <x,y,z>Slice
? Can numPlanes
be inferred from clippingPlanes
?
For now I was just using the
Good point, |
* 3D Viv Core (#409) * Initial commit * CHANGELOG. * Address comments. * Prettier. * 3D Docs (#411) * First pass at docs. * Clean up. * Add to docs. * Spelling & brief docs. * Change docs target * Update docs/3D_RENDERING_BRIEF.md Co-authored-by: Trevor Manz <trevor.j.manz@gmail.com> Co-authored-by: Trevor Manz <trevor.j.manz@gmail.com> * Fix 3D types/docs * Remove header. * Basic 3D Avivator (#412) * Initial commit * CHANGELOG. * Address comments. * Prettier. * [WIP] Avivator first pass. * Fix webpack config. * Fix restricted syntax. * 3D Non-Orthogonal Clipping Planes (#418) * Initial commit * CHANGELOG. * Address comments. * Prettier. * [WIP] Avivator first pass. * Add non-orthogonal clipping planes. * Use `flat` * Fix typo * Fix numPlanes padding * Fix plane equation. * Use sign function instead of ceil * Remove cast. * Use Plane API * Remove `numPlanes` argument. * (For 3D) Avivator Refactor (#420) * Initial commit * CHANGELOG. * Address comments. * Prettier. * [WIP] Avivator first pass. * [WIP] State management, some updates to Avivator. * [WIP] Adding more use of the global state. * [WIP] More state replacement. * Change color palette selector. * Use imgae settings. * Use viewer store. * Clean up unnecessary Avivator props. * Create self-contained buttons. * Refactor main `useEffect` to use hooks. * Fix snackbars. * Refactor Viewer. * Change names of buttons. * Refactor Snackbars * Remove unused vars. * Refactor menu. * Reset with new image. * Fix linting error. * Refactor props -> global state for dropzone components. * Remove more unnecessary props. * Colorpalette use global state. * Refactor selections. * Fix async selection bug. * Fix viewState/initialViewState issue. * Fix toggle. Remove dead code. * Small ids fix. * Refactor channel stats. * Use > instead of epsilon. * Revert loader change. * Fix import paths. * Tweaks. * Prettier. * Fix state bug and lens display. * Handle undefined loader in state. Small entries suggestion. * Reform state management. * Small code compleixty change. * Fix artifacts for additive. * Small Features/Fixes for Viv Src (#422) * Fixes for viv src * Update src/layers/ImageLayer.js Co-authored-by: Trevor Manz <trevor.j.manz@gmail.com> * Prettier, Co-authored-by: Trevor Manz <trevor.j.manz@gmail.com> * New Avivator (#421) * Initial commit * CHANGELOG. * Address comments. * Prettier. * [WIP] Avivator first pass. * [WIP] State management, some updates to Avivator. * [WIP] Adding more use of the global state. * [WIP] More state replacement. * Change color palette selector. * Use imgae settings. * Use viewer store. * Clean up unnecessary Avivator props. * Create self-contained buttons. * Refactor main `useEffect` to use hooks. * Fix snackbars. * Refactor Viewer. * Change names of buttons. * Refactor Snackbars * Remove unused vars. * Refactor menu. * Reset with new image. * Fix linting error. * Refactor props -> global state for dropzone components. * Remove more unnecessary props. * Colorpalette use global state. * Refactor selections. * Fix async selection bug. * Fix viewState/initialViewState issue. * Fix toggle. Remove dead code. * Small ids fix. * Refactor channel stats. * Use > instead of epsilon. * Revert loader change. * Fix import paths. * Tweaks. * Prettier. * Styling. * Slicers using polar coordinates. * Merge branch 'ilan-gold/avivator_refactor' into ilan-gold/new_avivator * Use epsilon value. * Use better range of theta. * onViewportLoad callbacks. * Remove plane flip * Move onViewportLoad to image settings. * Set up isLoading callbacks. * Fix AddChannel call backs. * Allow options to be disabled as well. * Simplify global selections * AbortController for volume layer * Only do keydown change selection * Add delay to onViewportload prop for volumes * Add slicer presets. Move slicer location. * Fix Camera Axis. * Debounce view state change. * Fix coordinate system for volume. * Change scaling of normal planes. * Linting. * Fix old merge issues * Change coordinates of slicing * Add isLoading for channel. * Add isChannelLoading removal. * Chane when channel is set to loading. * Fix jsdocs. Small fix for volume button. * Don't always use physical size scaling. * Fix loader physical size inference. * Make typescript happy. * Small fix. * Fix properties state bug. * Fix rotation recentering. * Use copy of clipping planes. * Fixes for viv src * Address comments. * Slicing Reversion + New Demo Datasets (#430) * Revert to orthogonal slicing. * Add idr datasets * Fix slicer styling. * Small doc fixes. * Add interpolation to 3D * Add check for interpolation. * prettier. * Final Changes for Avivator (#434) * Use tabs for controller. * WRong disabled cpondition for volume button * Change non-3d rendering mode display. * Small style tweaks. * Fix checkbox. Small styling issues. * Rename * Add disabled styling. * Add spacing. * Fix slicer styling. * Set bounding cube intiially. * Add warning about WebGL2 * Remind to refresh page. * Fix for 3D Blending. (#440) * Minimal Fix for 3D Blending. * Remove culling on layer * Add comment. * Prettier. * Add progress indicator option + onUpdate callback. (#446) Co-authored-by: Trevor Manz <trevor.j.manz@gmail.com>
Fixes one of the "nice to haves" from the roadmap:https://docs.google.com/document/d/1swidpzUFDjSZOjK98XW-r-QTVW9D8klgZ-3DYWUGA6c/edit#
My engineering estimates are often way off and this was one of those times - I had chalked this up to be a ton of work, but I had a bit of an epiphany while doing something unrelated, and then it only took about 15 minutes :)
Background
This PR allows for non-orthogonal (i.e not one of the axis-aligned
xSlice
,ySlice
, orzSlice
) clipping planes by allowing people to specify a list of normal vectors and offsets from the origin, the two of which together define the equation for a plane. We can then use this to decide how to clip the volume on the shaderChange List
- AddsnumPlanes
,normalClippingPlanes
, andoffsetClippingPlanes
props to our Layers and Viewers - edit the shaders accordingly.numPlanes
andclippingPlanes
props for clipping planes. Edit shaders accoringly.Checklist