Re: [Numpy-discussion] Another Array

2009-04-10 Thread Robert Kern
On Fri, Apr 10, 2009 at 02:17, Anne Archibald wrote: > 2009/4/10 Ian Mallett : > >> The vectors are used to "jitter" each particle's initial speed, so that the >> particles go in different directions instead of moving all as one.  Using >> the unit vector causes the particles to make the smooth pa

Re: [Numpy-discussion] Another Array

2009-04-10 Thread Anne Archibald
2009/4/10 Ian Mallett : > The vectors are used to "jitter" each particle's initial speed, so that the > particles go in different directions instead of moving all as one.  Using > the unit vector causes the particles to make the smooth parabolic shape. > The jitter vectors much then be of a random

Re: [Numpy-discussion] Another Array

2009-04-10 Thread Ian Mallett
This seems to work: vecs = Numeric.random.standard_normal(size=(self.size[0],self.size[1],3)) magnitudes = Numeric.sqrt((vecs*vecs).sum(axis=-1)) uvecs = vecs / magnitudes[...,Numeric.newaxis] randlen = Numeric.random.random((self.size[0],self.size[1])) randuvecs = uvecs*randlen[...,Numeric.newaxi

Re: [Numpy-discussion] Another Array

2009-04-10 Thread Robert Kern
On Fri, Apr 10, 2009 at 01:58, Ian Mallett wrote: > On Thu, Apr 9, 2009 at 11:46 PM, Robert Kern wrote: >> >> Parabolic? They should be spherical. > > The particle system in the last screenshot was affected by gravity.  In the > absence of gravity, the results should be spherical, yes.  All the v

Re: [Numpy-discussion] Another Array

2009-04-09 Thread Ian Mallett
On Thu, Apr 9, 2009 at 11:46 PM, Robert Kern wrote: > Parabolic? They should be spherical. The particle system in the last screenshot was affected by gravity. In the absence of gravity, the results should be spherical, yes. All the vectors are a unit length, which produces a perfectly smooth s

Re: [Numpy-discussion] Another Array

2009-04-09 Thread Robert Kern
On Fri, Apr 10, 2009 at 01:42, Ian Mallett wrote: > It gives a perfect parabolic shape that looks very nice, but somewhat > unrealistic. Parabolic? They should be spherical. > I'd like to scale the unit vectors by a random length (which > can just be a uniform distribution).  I tried scaling the

Re: [Numpy-discussion] Another Array

2009-04-09 Thread Ian Mallett
It gives a perfect parabolic shape that looks very nice, but somewhat unrealistic. I'd like to scale the unit vectors by a random length (which can just be a uniform distribution). I tried scaling the unit vector n*n*3 array by a random n*n array, but that didn't work, obviously. Help? _

Re: [Numpy-discussion] Another Array

2009-04-09 Thread Ian Mallett
This works; thank you. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Another Array

2009-04-09 Thread Robert Kern
On Thu, Apr 9, 2009 at 23:18, Ian Mallett wrote: > Hello, > > With the help of this list, over the past two days, I have implemented a GPU > particle system (picture here: > http://img7.imageshack.us/img7/7589/image1olu.png).  Every particle is > updated entirely on the GPU, with texture data (arr

[Numpy-discussion] Another Array

2009-04-09 Thread Ian Mallett
Hello, With the help of this list, over the past two days, I have implemented a GPU particle system (picture here: http://img7.imageshack.us/img7/7589/image1olu.png). Every particle is updated entirely on the GPU, with texture data (arrays) being updated iteratively between two framebuffer object