#Prabhu Ramachandran
import numpy as np
from mayavi import mlab
import time
def step(x, y, z):
data = np.random.random(x.shape)
cond = data > 0.75
return x[cond], y[cond], z[cond], data[cond]
#x, y, z = np.mgrid[0:10:50j, 0:10:50j, 0:4:20j]
x, y, z = np.mgrid[0:3:20j, 0:3:20j, 0:3:20j]
xn, yn, zn, sn = step(x, y, z)
# Will give you spheres, use mode='cube' for cubes.
pts = mlab.points3d(xn, yn, zn, sn, scale_mode='none', scale_factor=0.1)
#pts = mlab.points3d(xn, yn, zn, sn, mode='cube', scale_mode='none', scale_factor=0.1)
@mlab.animate
def anim():
while True:
xn, yn, zn, sn = step(x, y, z)
pts.mlab_source.reset(x=xn, y=yn, z=zn, scalars=sn)
# Do this if the scene does not update: needed for slightly older versions of Mayavi.
pts.mlab_source.update()
time.sleep(0.01) # Slow things down a bit.
yield
anim()
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
mayavi doesnot support wxphonix, so I wrote a simple one named myvi, I think it will be help to you.
https://github.com/yxdragon/myvi
on windows is ok, but on mack and linux cannot build gl3.3 context. I think it is wx's bug, (my vi can run ok with qt on mac and linux) anyone can help?
来自我的新浪邮箱android客户端