Skip to content

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

Merged
merged 23 commits into from
Nov 22, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
forced graphs using deprecated cameraposition attribute to stay upwards
  • Loading branch information
archmoj committed Nov 21, 2018
commit 9ef8a705526d463b71ab8fea8d2dd624b032c9bb
2 changes: 1 addition & 1 deletion src/plot_api/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ exports.cleanLayout = function(layout) {
scene.camera = {
eye: {x: eye[0], y: eye[1], z: eye[2]},
center: {x: center[0], y: center[1], z: center[2]},
up: {x: mat[1], y: mat[5], z: mat[9]}
up: {x: 0, y: 0, z: 1} // we just ignore calculating camera z up in this case
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous calculations of camera.up for gl3d_surface-lighting & gl3d_ibm-plot didn't set up vector close to [0,0,1].
I thought we may ignore camera z up if cameraposition depreciated setting is used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution.

Copy link
Contributor

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.png baseline changed because of this?

Copy link
Contributor

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!

};

delete scene.cameraposition;
Expand Down
16 changes: 0 additions & 16 deletions test/image/mocks/gl3d_text-weirdness.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,6 @@
],
"layout": {
"autosize": true,
"undefined": {
"cameraposition": [
[
0.13855639464070454,
0.5365430934822464,
0.7678929376547012,
-0.32134727420767745
],
[
0,
0,
0
],
1.8771354322421991
]
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this might not be necessary. If one wants to enable cameraposition it is required to use "scene" instead of "undefined"! Also now I am curious about this mock & why it was named weirdness? Also if we could possibly remove it or reduce the width/height.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow. Thanks for fixing this. That undefined shouldn't be there.

"title": "Scatter3d with text weirdness",
"showlegend": false,
"height": 758,
Expand Down