Re: [Bf-committers] matrix multiplication in Blender SVN of this morning (W32 Vista mingw compiled)

2011-07-27 Thread Benoit Bolsee
Hi, I repeat once more: mathutils matrices are COLUMN-MAJOR. This means that the top elements in the definition list are columns, not rows, despite the fact that they are printed horizontaly. So the following code: m1 = Matrix([[ 1, 0, 2], [-1, 3, 1]]) m2 = Matrix([[3, 1],[2, 1],[1, 0]])

Re: [Bf-committers] matrix multiplication in Blender SVN of this morning (W32 Vista mingw compiled)

2011-07-27 Thread Campbell Barton
I'll be sure to include this in the API docs, possibly my change to repr caused more confusion since the string output of a matrix is: Matrix() Matrix(((1.0, 0.0, 0.0, 0.0), (0.0, 1.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, 0.0, 0.0, 1.0))) We could remove \n's

Re: [Bf-committers] matrix multiplication in Blender SVN of this morning (W32 Vista mingw compiled)

2011-07-27 Thread Paul Melis
Just chiming in here On 07/27/2011 12:47 PM, Benoit Bolsee wrote: Hi, I repeat once more: mathutils matrices are COLUMN-MAJOR. This means that the top elements in the definition list are columns, not rows, despite the fact that they are printed horizontaly. [...] Mathutils matrices are

Re: [Bf-committers] matrix multiplication in Blender SVN of this morning (W32 Vista mingw compiled)

2011-07-27 Thread Morten Mikkelsen
I am with you on this one. Memory layout is one thing. Abstraction is something else entirely. Afterall, one could choose the memory layout to be some crazy fixed random layout or a swizzled layout or whatever. And in both cases there is no reason why, at abstraction level, either one could be

Re: [Bf-committers] matrix multiplication in Blender SVN of this morning (W32 Vista mingw compiled)

2011-07-27 Thread Campbell Barton
This is definitely possible with the api (and probably not all that much work) but its quite a big change for some script authors - unlike multiplication order (trivial by comparison). I don't have a sense for whats normal here since I only use mathutils but if this is so confusing and most/all

Re: [Bf-committers] matrix multiplication in Blender SVN of this morning (W32 Vista mingw compiled)

2011-07-27 Thread Morten Mikkelsen
well actually I am used to column major myself (at the abstraction level). I only meant I agree that memory layout and abstraction does not have to be the same when it comes to row vs, column major. cheers, Morten. On Wed, Jul 27, 2011 at 7:16 AM, Campbell Barton ideasma...@gmail.comwrote:

Re: [Bf-committers] matrix multiplication in Blender SVN of this morning (W32 Vista mingw compiled)

2011-07-27 Thread Jim Williams
This seems like the basis of a religious war...like endianness. Even though I generally like to do things the way mathematicians do it, I'd suggest leaving it the Blender traditional way by default and invite anyone who strongly prefers it the other way to write an API function to switch the

Re: [Bf-committers] matrix multiplication in Blender SVN of this morning (W32 Vista mingw compiled)

2011-07-27 Thread Morten Mikkelsen
This seems like the basis of a religious war...like endianness. Then let's make sure we don't turn it into one. That being said I don't think this should keep us from discussing the subject. It's a relevant issue and we have moderators to deal with spats. Cheers, Morten. Even though

Re: [Bf-committers] matrix multiplication in Blender SVN of this morning (W32 Vista mingw compiled)

2011-07-27 Thread Peter K.H. Gragert
I just played with numpy and the numpy matrix behaves in print and operation as is (for me at least) normally done in mathematics and so is done in the wikipedia.org about matrices!!! So eventually one could look there how it is done, that layout and mathematical interpretation is the same

Re: [Bf-committers] matrix multiplication in Blender SVN of this morning (W32 Vista mingw compiled)

2011-07-27 Thread Peter K.H. Gragert
I forgot to mention the meaning of m1 *= m2 (it should be mathematically correct as it look like not to be so) (see start of this thread) Peter ___ Bf-committers mailing list Bf-committers@blender.org

[Bf-committers] matrix multiplication in Blender SVN of this morning (W32 Vista mingw compiled)

2011-07-26 Thread Peter K.H. Gragert
Hallo, First try ... Put this text in the console and run it code start= import bpy from mathutils import Matrix print(\nSTART---) m1 = Matrix([[ 1, 0, 2], [-1, 3, 1]]) print(m1, \nelement R(2,3)) m2 = Matrix([[3, 1], [2, 1], [1, 0]])