[matplotlib-devel] rendering problem in mplot3d

2010-07-17 Thread H Mike Duan
Hi,

There seems to be a problem in how 3D surfaces and lines are rendered
in mplot3d. The following is a simple script that plots a yellow
sphere, a blue wireframe on the surface of the sphere, and a red
wireframe outside the sphere. The semi-transparent yellow sphere is
rendered beautifully. The blue wireframe can only be seen with certain
viewing angles. The red wireframe is seen all the time, but its part
that is supposedly behind the sphere appears in front of the sphere.
Did I do something wrong or is it a bug of mplot3d? I am using
matplotlib 1.0.0 on Mac OS X 10.6. Thanks!

-Mike

===
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.gca(projection='3d')

u = np.linspace(0, 2 * np.pi, 100)
v = np.linspace(0, np.pi, 100)

x = 10 * np.outer(np.cos(u), np.sin(v))
y = 10 * np.outer(np.sin(u), np.sin(v))
z = 10 * np.outer(np.ones(np.size(u)), np.cos(v))
ax.plot_surface(x, y, z,  rstride=4, cstride=4, color='y', alpha=0.5)
ax.plot_wireframe(x, y, z, rstride=10, cstride=10, color='b')
ax.plot_wireframe(x*1.1, y*1.1, z*1.1, rstride=20, cstride=20, color='r')

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] rendering problem in mplot3d

2010-07-18 Thread H Mike Duan
Ben,

> Yes, there is a known issue with objects not properly rendering when viewed
> at certain angles.  How to go about solving this seems to be a difficult one
> to figure out.

I think the problem is that mplot3d can't reliably determine which
parts of the surfaces or lines are in front and which are behind. This
is especially clear in the test example where the yellow sphere
doesn't cover parts of the red wire frame. The issue that some objects
can only be seen at certain angles is likely to be a consequence of
this bug.

I want to use mplot3d to visualize my simulations. Is it your opinion
that this bug can't be fixed in a short term? If so, I'll have to
explore other options. Thanks!

-Mike

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel