-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: Axes3D does not respect distance from camera. #23392
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
Comments
FYI, in the current main branch they both look as the 0.253 case, so something has happened although it is still not as expected. |
This is a duplicate of #12260 unfortunately Matplotlib cannot do proper 3D rendering. |
This is a known issue, I suspect a typo the cross referencing. I'm not sure what issue Jody was aiming for though. |
Thanks for the clarification @tacaswell! Upon further research, I see that the z-order of 3D objects with nontrivial occlusions is indeed a common issue. Is it possible for me to contribute here? I have some experience with OpenGL. I notice this part of the current docs
and this part as well
|
Sorry #12620! It would be great to have proper rendering but that is a big project! |
@kdbanman The problem is that Matplotlib doesn't really have a 3D-capable renderer/rasterizer. To do this properly you'd need to do one of:
|
@dopplershift thanks for the context. mplot3d's capabilities are impressive, considering it's not already wrapped OpenGL. I had assumed there was a wrapper in place which might just need patching. Is there an existing example of wrapped renderer in matplotlib I could refer to? I'm curious to see a rough example of architecture. Obviously OpenGL is a bit of a different animal - I'm guessing platform and backend portability would be big challenges. |
There have been some parallel efforts at opengl plotting with python, and
there have been occasional discussions on how to eventually integrate those
efforts back into matplotlib. Some projects to check out are vispy:
https://vispy.org/ and glumpy https://glumpy.github.io/ (although, I
*think* glumpy has been integrated into vispy by now?). Maybe these
projects can give you a leg up?
…On Wed, Jul 6, 2022 at 6:12 PM Kirby Banman ***@***.***> wrote:
@dopplershift <https://github.com/dopplershift> thanks for the context.
mplot3d's capabilities are impressive, considering it's not already wrapped
OpenGL. I had assumed there was a wrapper in place which might just need
patching.
Is there an existing example of wrapped renderer in matplotlib I could
refer to?
I'm curious to see a rough example of architecture. Obviously OpenGL is a
bit of a different animal - I'm guessing platform and backend portability
would be big challenges.
—
Reply to this email directly, view it on GitHub
<#23392 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACHF6DJCPDSAUJUALZ44P3VSYAE3ANCNFSM522K4MKQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Bug summary
When plotting a surface and scatter points with
Axes3D
, either none of the scatter points are occluded by the surface or all of them are occluded. Whether or not they are occluded appears to depend upon a numerical threshold. (Speculation: perhaps the occlusion of a single point?)Code for reproduction
Actual outcome
Expected outcome
Both plots should look like this, with occlusion determined point-by-point.
(This was manually composited with an image editing tool, AFAICT this cannot be generated by matplotlib until the bug is fixed.)
Additional information
This global occlusion occurs with many combinations of plots, not exclusively
.plot_surface
and.scatter3D
. The occluder or the occluded can be generated by any of.plot_trisurf
.plot_surface
.scatter3D
.plot_wireframe
and possibly others. I did not test to find the numerical edge of occlusion/non-occlusion with the other combinations.
Perhaps this is related to other github issues related to depth testing or the underlying z-buffer.
Operating system
Ubuntu 18.04.5 LTS, kernel 5.4.188+
Matplotlib Version
3.2.2
Matplotlib Backend
module://ipykernel.pylab.backend_inline
Python version
3.7.13
Jupyter version
5.3.1 (via google colab release 2022/6/10)
Installation
No response
The text was updated successfully, but these errors were encountered: