Thanks for the example, Stéfan! I'm trying to work this into a position texture, and the arrays need interleaving. I tried a couple times. Here's what I have:
az = numpy.random.uniform(0, numpy.pi * 2, size*size) el = numpy.random.uniform(0, numpy.pi, size*size) r = numpy.random.uniform(size*size) # Transform random variable r = r ** (1/3.) * 1 el = numpy.arccos(1 - 2*el) x = r * numpy.cos(az) * numpy.sin(el); y = r * numpy.sin(az) * numpy.sin(el); z = r * numpy.cos(el) randvecs = numpy.array([x,y,z]).reshape((size,size,3)) rgb = ((randvecs+1.0)/2.0)*255.0 surface = pygame.surfarray.make_surface(rgb) I think the arrays are being concatenated. Hence, visually, it doesn't look right... Ian
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion