Skip to content

Improve rendering of lines in 3D (against disappearing in certain angles) issue #691 #3128

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

Closed
wants to merge 10 commits into from

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Oct 19, 2018

Previously the angles computed in the gl-plot3d module necessary to match rectangle shapes towards camera point were not accurate. Therefore 2D representations of 3D lines were not oriented properly in various perspective angles. Disappearing and tininess impacts resulted from the bug could be clearly observed namely when the thicknesses of lines using scatter3d were increased. Please refer to the issue #691 for more information.
This PR improves rendering of lines in 3D scenes by performing proper 3D/2D calculations within the webgl vertex shader of the module.
@alexcjohnson

package.json Outdated
@@ -74,7 +74,7 @@
"gl-contour2d": "^1.1.4",
"gl-error3d": "^1.0.7",
"gl-heatmap2d": "^1.0.4",
"gl-line3d": "^1.1.2",
"gl-line3d": "git://github.com/gl-vis/gl-line3d.git#dfbd94f4290d30097c9b7c9f36d2a241732124c0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexcjohnson
Copy link
Collaborator

Thanks @archmoj - In the image tests I see a bunch of minor changes but nothing that I can clearly point to and say "yes, that was a bug and now it's fixed." Can you include a new image, like the one posted in #691, to make it obvious what was fixed? Then, since it doesn't generate a diff, post a screenshot in a comment "here's what this image looks like on the master branch, notice the missing line between the top two points" or whatever.

I do think I see something a little odd, the change in gl3d_set-ranges - the clipped line got a little bit longer, and if I rotate the scene it looks like it's popping out the top just a tiny bit:
screen shot 2018-10-22 at 9 16 39 am
Was that intentional / expected?

@archmoj
Copy link
Contributor Author

archmoj commented Oct 22, 2018

Before:
newplot 52
After:
newplot 53

@alexcjohnson
Copy link
Collaborator

Thanks - that before/after comparison is exactly what I wanted to see. The segment joins definitely look better now 🌟
#691 also shows an issue of some segments disappearing entirely, or becoming very thin compared to others. Can we include a case like this in the test image too?

@archmoj
Copy link
Contributor Author

archmoj commented Oct 23, 2018

Yes I've already added this to the image test. But I would like to possibly add few other traces to better show the changes.

@archmoj
Copy link
Contributor Author

archmoj commented Oct 25, 2018

To compare previous and new images:
8641bed?short_path=59dc7bd#diff-59dc7bd2fd8bab2b682e77565af6615b

@archmoj
Copy link
Contributor Author

archmoj commented Oct 26, 2018

To compare previous gl-line3d with new gl-line3d performance, please view old & new images here:
420fe72?short_path=59dc7bd#diff-59dc7bd2fd8bab2b682e77565af6615b

@@ -74,7 +74,7 @@
"gl-contour2d": "^1.1.4",
"gl-error3d": "^1.0.7",
"gl-heatmap2d": "^1.0.4",
"gl-line3d": "^1.1.2",
"gl-line3d": "git://github.com/gl-vis/gl-line3d.git#33b9e850de754cde38d859328ae562125edc90f2",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@etpinard
Copy link
Contributor

Closing in favour of #3163

@etpinard etpinard closed this Oct 26, 2018
@etpinard etpinard deleted the issue-691 branch October 26, 2018 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants