From: Ben A. <BAx...@co...> - 2010-02-22 16:02:10
|
John, your assesment of the problem is correct. And I believe your suggested solution is also correct. Currently, each call to a mplot3d plot method is treated independantly. They get converted into custom PolyCollections which each do the Z-order sorting. There is still an issue here however. Even if we implement the aformentioned solution, we are still only approximating a 3d library. And the result will still not be as nice as matlab. I believe that because we treat the surface as a series of 2D polygons, the intersection between two surfaces will be at the polygon edges. See the attached image for an example of what the intersection between a sphere and plane might look like. As a side note, this was a major barrier to me displaying multi-colored 3d bar plots as seen here: http://www.benaxelrod.com/temp/bar3d-2.png. But I fixed some color parameter issues in bar3d so that I can now call bar3d only once, and pass in color arrays so that now it renders properly. I will hopefully be able to submit a patch for this soon. -Ben -----Original Message----- From: John Hunter [mailto:jd...@gm...] Sent: Sunday, February 21, 2010 9:24 PM To: David Arnold Cc: Ben Axelrod; Jakub Nowacki; mat...@li...; Reinier Heeres Subject: Re: [Matplotlib-users] mplot3d stays? Importance: Low On Sun, Feb 21, 2010 at 7:15 PM, David Arnold <dwa...@su...> wrote: > Hi, > > What prevents me from using mplot3d in the classroom is highlighted by the following example. I believe the problem arises because each artist (ie each polygon, line or 3d text object) is rendered separately, and so there is no way different faces from the same object to be rendered on different sides of another object in the scene. I am no expert on the mplot3d internals or pipeline, but it seems like the solution is for each artist to transform the faces of their respective polys and place them in a Axes3D level list (or other data structure) along with their properties (eg facecolor, alpha) and then do a zordering and clipping at the axes level rather than the artist level before rendering. One might use a custom PolyCollection for this.... For those of you with more familiarity with mplot3d internals: is this approach viable/feasible? JDH |