-
Notifications
You must be signed in to change notification settings - Fork 60
Refactor z-order to ensure axes are on top #906
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
Conversation
|
One thing that makes this tricky is that although a lot of examples / use-cases are 2D, it's hard to determine reliably when we can assume the scene to be 2D. Therefore I went with an approach that more or less assumes 3D but also works well in 2D. |
|
Older images pushed back, so this means if I add a new image it will appear on top of the existing ones? This is desired and most intuitive, and is similar with other plotting libs. If I add a like and then scatter points, these points will appear on top of the line? Usually the scene is 3D if the camera.fov > 50 Btw there was this related ideas before: #839 |
Exactly. And yet the top image will still be below the points, lines, and axes.
Yes. But here it's a bit more tricky, since (assuming the data is 2D) they are both at There are a few reasons why depth-fighting should be unlikely:
For reference, other measures we can take for depth fighting:
Usually ... but it's perfectly sensible for sciency 3D data to be rendered using orthographic projection. Whether pan-zoom is used (and looking down z) would be a more appropriate signal. In any case, I really like the idea to create the scene in a way that works for both 2D and 3D cases, so users can switch and all keeps making sense. I think we can make that work.
In the comment in #839 I still assumed the scene was always 2d :) |
|
📚 Docs preview built and uploaded! https://www.fastplotlib.org/ver/z-order |
Can you explain this a bit? I also made a issue on pygfx to understand |
kushalkolar
left a comment
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.
very nice, few comments 😄
|

Closes #903, closes #839.
depth_campare="<="so that for objects at the same depth, the render order determines which one is on top.render_queueof axes so they are rendered later than all the other objects.This should make it that axes and graphics interact as expected in both 3D and 2D scenes. Note that in a 2D view (panzoom controller), if a scatter graphic has data that is nonzero for z, it can indeed cover the axes, but this is expected.