-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
3D cone traces #2641
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
Merged
Merged
3D cone traces #2641
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
ec64895
scaffold cone
etpinard 5736290
move 3d parseColorScale to gl_format_color
etpinard cb7cb7f
get cone colorbar and vx/vy/vz mesh grid to work
etpinard 89eaf11
add three cone mocks
etpinard 863b0da
implement 'sizemode' and 'sizeref'
etpinard fa32a74
add lib/cone.js + add cone to gl3d bundle
etpinard 71e46af
hook in hover labels for cones
etpinard a2c3694
clean up scene computeTraceBounds
etpinard a2db567
find min/max u/v/w norm in calc directly
etpinard db8222b
add "pad" using max u/v/w norm around cone bounds
etpinard 55700b8
add 'anchor' to mimic gl-cone3d's coneOffset
etpinard e4a2035
add cone-specific hoverinfo flags
etpinard a02dd11
fixup cmin/cmax -> vertexIntensityBounds
etpinard cb7ef43
improve interplay between vector and cone position attributes
etpinard e718c66
fixup hover gl-scatter3d trace for cone with set `cones.(x|y|z)`
etpinard f651eec
use stashed gl-cone3d field as hover x/y/z u/v/w fields
etpinard 3f3bfac
rename image-exporter -> orca
etpinard aaf7249
mv gl3d_cone-* out of `npm run test-image` into noci_test.sh
etpinard d5d6f33
add some cone tests
etpinard b7465fb
add hover label test for cones
etpinard 5a42de0
comment out cones.(x|y|z) attributes for now
etpinard 04d3d91
better pad value for autoranged cones
etpinard 2a45dae
revert to current gl-cone3d master
etpinard 8dca9ae
factor out `visible: false` converse test
etpinard 3d26d47
fixup cone autorange pad computation
etpinard 5a59bc7
fixup pad autorange (again)
etpinard 3dd6cf5
pass gl-mesh3d lighting params
etpinard fb2ec1e
use gl-cone2d "vectorScale" to get better autorange pad value
etpinard 74ecbf8
scaled pad value by normMax only under sizemode: 'scaled'
etpinard abb11e0
sub in npm version for gl-cone3d
etpinard 8e8f5d6
fixup tests post 74ecbf8
etpinard 2c08357
add autorange test case for "scaled up the x/y/z arrays"
etpinard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What do you mean by a grid unit here? Is it one unit of the
(x, y, z)
positions or the spacing between adjacent cones?Almost always the vectors have different units from the position space they're displayed in - so I'd think if you specify nothing at all about the cone sizing, they should end up scaled so the largest one is about as big as the smallest spacing between adjacent cones.
There's definitely a use case for
'absolute'
- the user has pre-calculated everything and they want each cone to go from one precise(x, y, z)
to another precise(x, y, z)
. I'm not sure there's a use case though for scaling to one unit in position, I'd think'scaled'
should refer to the minimum adjacent cone distance.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.
To be honest, I'm not sure. I copied this from https://github.com/gl-vis/gl-cone3d#constructor I'll have to inspect
https://github.com/gl-vis/gl-cone3d/blob/c675b25e5991e63d0ad23ed24d712c496c28cd72/cone.js#L138-L246
a little bit more.
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'll have a new look at the cone sizing parameters. Pre-meshgrid they were based on the position space units and scaled so that two cones with maximum norm, pointing to the same direction, would have their tip and base touch. Like <|<|. That would be with coneSize 2. With coneSize 1, you'd get no overlapping cones even when they're |><|.
The absolute sizing ditched the automatic cone scaling and used the cone vector norm to figure out the size of the cone model, so that a norm of 1 with absolute size factor 1 results in a cone that's one unit tall in the position unit space. Absolute size factor 2 => 2 unit tall cone, etc.
With the meshgrid sampling (and the realization that the cone positions may not be on a nice regular grid), I changed the automatic cone sizing to scale based on the smallest distance between two adjacent cone positions (adjacent in the sense that they've got successive indices in the positions array). This is not the right thing to do though, doing a smallest distance between any two cone positions would be, but that's O(n^2) with a naive algo.
Another idea floated on the sizing was to have pixel-based sizing as well, which'd probably work like "invert the projection, view and model transform matrices for cone model, scale cone model according to viewport size" but would result in ortho camera cones which might be confusing. (And it sounds like a bit of a pain to implement.)
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.
@kig that all sounds great. I guess we only need to worry about the smallest-distance calculation when using the
(x, y, z)
data to position the cones; With the cartesian product of x/y/z interpolation grids each dimension should be pretty compact, even if the values are out of order. But I guarantee at some point we'll see a data set where the closest points are not successive. I don't know if there's a JS implementation already available but it's possible to do it in O(n log(n)^2) http://www.cs.ucsb.edu/~suri/cs235/ClosestPair.pdfLets not worry about pixel-based sizing, at least not for now. I guess I can see using this if we also do automatic grid spacing, ie when you zoom in and the cone spacing gets larger, at some point we decrease the grid size so we draw more cones between the existing ones. That's definitely not a v1 feature 😅