You're right - if I just change the surface to be opaque, some of the
scatter points randomly disappear and reappear depending on "camera"
angle.

So how does it decide which points are behind/in front of the surface,
then?  I can't figure out any obvious pattern...

And is it possible to use the z-order mechanism to get around this?
(e.g. individually set the z-order of scatter points and the patches
in the surface so that at least very roughly the correct pieces are
rendered in front?)

On Mon, Oct 4, 2010 at 1:04 PM, Benjamin Root <ben.r...@ou.edu> wrote:
> On Mon, Oct 4, 2010 at 2:21 PM, Erik Tollerud <erik.tolle...@gmail.com>
> wrote:
>>
>> I've noticed some odd behavior in the mplot3d toolkit when using
>> scatter3D with plot_surface.  What I want to do is generate the
>> surface with an alpha level of 0.5, such that any points that are
>> between me and the surface should come out fully opaque, and any
>> points behind the surface should be rendered blended with the surface.
>>  Instead, the scattered points are blended with the surface regardless
>> of whether they are in front of it or behind.  There's also a weird
>> behavior where, depending on the viewing angle, the points will
>> suddenly snap from fully opaque (even if behind the surface) to
>> transparent.  An example is attached, with renderings of the two
>> states in the URLs below.
>>
>> Is this a bug, or am I doing something wrong?
>>
>> http://dl.dropbox.com/u/8683962/mpl3dalpha-1.png
>> http://dl.dropbox.com/u/8683962/mpl3dalpha-2.png
>>
>> --
>> Erik Tollerud
>>
>
> At first glance, I wonder if this is just because of mplot3d's naive
> approach of figuring out what is behind other things.  mplot3d doesn't do
> any sort of physics or ray-tracing to figure out how elements are positioned
> relative to the camera.  Try it again with perfectly opaque surface and
> dots, and I bet you will have dots "magically" appearing in front of the
> surface at certain viewing angles and then disappearing.
>
> Note, I have only looked at the photos, not the code.
>
> Ben Root
>
>



-- 
Erik Tollerud

------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to