1

I am new to Blender and I have a pretty basic question. I have a 3D numpy array of grass vertices that I would like to load and render in Blender. This is what I would normally do with numpy and matplotlib:

from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection

data_folder = '../data/seville/'
world_name = 'world5000_gray.mat'

matlab_world  = sio.loadmat(data_folder + world_name)

X = matlab_world['X']
Y = matlab_world['Y']
Z = matlab_world['Z']

grass_verts = np.dstack((X, Y, Z))
p_grass = Poly3DCollection(grass_verts,
                           array=colours[:,0],
                           edgecolor='none',
                           cmap=grass_cmap)

…some code missing…

The question I have is, how do I do this from within the Blender scripting environment?

zeffii
  • 39,634
  • 9
  • 103
  • 186
Aidan Rocke
  • 111
  • 2
  • 1
    are those vertices something like a position of each leaf of grass? – zeffii Aug 15 '15 at 08:05
  • related http://blender.stackexchange.com/questions/2407/how-to-create-a-mesh-programmatically-without-bmesh/2416#2416 possibly duplicate – zeffii Aug 15 '15 at 10:09
  • 1
    If the linked Question above doesn't answer your problem please update your question with more information describing what you would like to be able to do. – zeffii Aug 15 '15 at 10:15
  • @zeffii I appreciate your help and I think that the link you referred answers my question very well. Thanks. – Aidan Rocke Aug 15 '15 at 11:31

0 Answers0