Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
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 |
Sorry, something went wrong.
|
if I add a new image it will appear on top of the existing ones? Exactly. And yet the top image will still be below the points, lines, and axes. If I add a like and then scatter points, these points will appear on top of the line? Yes. But here it's a bit more tricky, since (assuming the data is 2D) they are both at z=0, and depth-fighting may be a thing. There are a few reasons why depth-fighting should be unlikely:
For reference, other measures we can take for depth fighting:
Usually the scene is 3D if the camera.fov > 50 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. Btw there was this related ideas before: #839 In the comment in #839 I still assumed the scene was always 2d :) |
Sorry, something went wrong.
|
📚 Docs preview built and uploaded! https://www.fastplotlib.org/ver/z-order |
Sorry, something went wrong.
Sorry, something went wrong.
|
Lines, points, and axes use depth_campare="<=" so that for objects at the same depth, the render order determines which one is on top. Can you explain this a bit? I also made a issue on pygfx to understand depth_compare better so maybe I'll wait for that. |
Sorry, something went wrong.
There was a problem hiding this comment.
very nice, few comments 😄
Sorry, something went wrong.
|
Lines, points, and axes use depth_campare="<=" so that for objects at the same depth, the render order determines which one is on top. Can you explain this a bit? I also made a issue on pygfx to understand depth_compare better so maybe I'll wait for that. |
Sorry, something went wrong.
Closes #903, closes #839.
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.