Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2k
Bug fix: applying camera up.z vector at scene init#3256
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
f82007bd8ef9eb556268beb72856789cfd94014c351ae12b3cb6dab767ea4295c3742c3ab1b1d5b24f51d338058b8da9ba899b568724416bc9eed54b65fa61d25c335f8bf4726af04f29ef8a70f43f944File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -110,6 +110,31 @@ function handleGl3dDefaults(sceneLayoutIn, sceneLayoutOut, coerce, opts) { | ||
| sceneLayoutIn, sceneLayoutOut, opts | ||
| ); | ||
| coerce('dragmode', opts.getDfltFromLayout('dragmode')); | ||
| var dragmode = opts.getDfltFromLayout('dragmode'); | ||
| if(dragmode !== false) { | ||
| if(!dragmode) { | ||
| dragmode = 'orbit'; | ||
| if(sceneLayoutIn.camera && | ||
| sceneLayoutIn.camera.up) { | ||
| var x = sceneLayoutIn.camera.up.x; | ||
| var y = sceneLayoutIn.camera.up.y; | ||
| var z = sceneLayoutIn.camera.up.z; | ||
| if(!x || !y || !z) { | ||
| dragmode = 'turntable'; | ||
| } else if(z / Math.sqrt(x * x + y * y + z * z) > 0.999) { | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This PR is getting better by the minute. Thanks for your efforts @archmoj Now, would there be a way to tweak this condition such that ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point @etpinard. Let me check. | ||
| dragmode = 'turntable'; | ||
| } | ||
| } else { | ||
| dragmode = 'turntable'; | ||
| } | ||
| } | ||
| } | ||
| coerce('dragmode', dragmode); | ||
| coerce('hovermode', opts.getDfltFromLayout('hovermode')); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -42,22 +42,6 @@ | ||
| ], | ||
| "layout": { | ||
| "autosize": true, | ||
| "undefined": { | ||
| "cameraposition": [ | ||
| [ | ||
| 0.13855639464070454, | ||
| 0.5365430934822464, | ||
| 0.7678929376547012, | ||
| -0.32134727420767745 | ||
| ], | ||
| [ | ||
| 0, | ||
| 0, | ||
| 0 | ||
| ], | ||
| 1.8771354322421991 | ||
| ] | ||
| }, | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought this might not be necessary. If one wants to enable Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow. Thanks for fixing this. That | ||
| "title": "Scatter3d with text weirdness", | ||
| "showlegend": false, | ||
| "height": 758, | ||
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.
Previous calculations of
camera.upforgl3d_surface-lighting&gl3d_ibm-plotdidn't set up vector close to [0,0,1].I thought we may ignore camera z up if
camerapositiondepreciated setting is used.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.
Nice solution.
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.
... and I presume the
gl3d_opacity-surface.pngbaseline changed because of this?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.
Ignore that last comment. I didn't see #3256 (comment)
Thanks!