-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Simplified webgl_lines_fat_raycasting.html #25191
Conversation
This is the original demo. It appears buggy to me when the threshold is increased. Maybe the intersection is occurring on the edge of the threshold, rather than on the closest point within the range of the threshold? /ping @bergden-resonai |
Would you like to clarify this issue before merging? Or is your PR ready to go? |
Ready to go, please. :-) |
I think this is an artifact of the point the demo is displaying and the behavior of this kind of threshold testing. The intersection is being checked with expanded threshold width but point displayed is the closest point on the center line. So when the model rotates and a new line comes into the foreground - the first-interscted line changes and the displayed point "jumps" to the closest point on the line. I think that's the issue you're referring to, at least? |
I am not a fan of spinning demos like this. The demo has been buggy and no-one knew it. Either the display is incorrect, or the algorithm is incorrect. I would vote to remove the unnecessary animation loop. |
IIUC, both the display and the animation are correct The animation was added very recently to expose potential bugs related to transformations - and I think it also increased the visibility of this issue, so I'm not sure I understand the downside of this in terms of improving the raycasting code I can't find a reference to how this is implemented elsewhere, I'm not a big fan of the capsules, but it makes corners very simple to handle which is fun |
Is the spinning not the quality that made this behavior more apparent?
The same behavior occurs with the line object in core... (red is returned point, green is cursor) If you can specify the behavior that you want that's fine but the again the "right" thing to do for the general case is not obvious. The threshold parameters are designed to make line selection easier. Simply selecting the line that is closest in screenspace is one solution but would lead to odd "popping" and ambiguous behavior when trying to select a close foreground with a distant background line oriented perpendicularly behind it.
I'm not sure what you mean by this. 2D capsules are used for the screenspace thick lines - which do not work for lines with perspective attenuation. |
Yes, I would have been happier with a single transform applied once, instead of the animation addition. The test line could even be commented out. // mesh.rotation.y = 1; // test TBH, rather than modifying an example to demonstrate that a former bug no longer exists, I think adding a new test case to the unit tests is the best option. (But it is true, only the core has unit tests.) |
Perhaps the "segments" image above is correct in 3D -- it just appears incorrect in 2D... But how to explain the "line" image above? |
The demo seemed unnecessarily complex to me, given its objective.
Removed the inset div. It is sufficient for the inset to be included in only
webgl_lines_fat.html
.Reduced the rotation speed. Spinning demos only serve to obfuscate bugs, so this was a compromise.
General clean up.