On Sun, Feb 28, 2010 at 5:53 PM, Ian Mallett <geometrian@gmail.com> wrote:
Hi,
I have a list of vec3 lists (e.g. [[1,2,3],[4,5,6],[7,8,9],...]). To every single one of the vec3 sublists, I am currently applying transformations. I need to optimize this with numpy.
To get proper results, as far as I can tell, the vec3 lists must be expressed as vec4s: [[1,2,3],[4,5,6],[7,8,9],...] -> [[1,2,3,1],[4,5,6,1],[7,8,9,1],...]. Each of these needs to be multiplied by either a translation matrix, or a rotation and translation matrix.
I don't really know how to approach the problem . . .
As I understand it, you want *different* matrices applied to each vector? There are generalized ufuncs, which I haven't tried, but for small vectors there is a trick. Let's see... heck, gmane looks to be dead at the moment. Anyway, I posted the method on the list here a couple of years ago and I'll put up a link if I can find it when gmane comes back. Chuck