[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25511] trunk/blender/source/blender/ python/generic/matrix.c: [#20446] mathutils: bugfix for matrix * matrix - patch by Paul Parchenko (parfoure) thanks

Benoit Bolsee benoit.bolsee at online.be
Tue Dec 22 11:41:14 CET 2009


Hi,

I've reverted this patch because the formula was correct. The problem
raised in this bug report is actually a consequence of the various
tranpose bugs in matrix.c that I've fixed in revision 23052. These fixes
restore the mathematical meaning of matrix and vector multiplications
but require to change existing scripts.

I take this opportunity to remind the guidelines to change the scripts
detailed in the commit log:
http://lists.blender.org/pipermail/bf-blender-cvs/2009-September/022245.
html

And for those interested in the theory I've writen detailed explanations
in the bug report:
http://projects.blender.org/tracker/?func=detail&atid=498&aid=20446&grou
p_id=9

In any case, the formulas in matrix.c are correct, so please do not
reintroduce transpose bugs. 

/benoit


> Log Message:
> -----------
> [#20446] mathutils: bugfix for matrix * matrix - patch by 
> Paul Parchenko (parfoure) thanks
> 
> >From the tracker:
> - typo was making the multiplication to transpose resulting 
> matrix eg #### from Mathutils import * from math import radians
> 
> cont = GameLogic.getCurrentController()
> owner = cont.owner
> 
> owner.worldOrientation = RotationMatrix(radians(1), 3, 'z') * 
> owner.worldOrientation ####
> 
> Modified Paths:
> --------------
>     trunk/blender/source/blender/python/generic/matrix.c
> 
> Modified: trunk/blender/source/blender/python/generic/matrix.c
> ===================================================================
> --- trunk/blender/source/blender/python/generic/matrix.c	
> 2009-12-21 23:14:16 UTC (rev 25510)
> +++ trunk/blender/source/blender/python/generic/matrix.c	
> 2009-12-22 07:27:53 UTC (rev 25511)
> @@ -944,7 +944,7 @@
>  				for(z = 0; z < mat1->rowSize; z++) {
>  					dot += 
> (mat1->matrix[z][y] * mat2->matrix[x][z]);
>  				}
> -				mat[((x * mat1->colSize) + y)] 
> = (float)dot;
> +				mat[((y * mat1->rowSize) + x)] 
> = (float)dot;
>  				dot = 0.0f;
>  			}
>  		}
> 



More information about the Bf-committers mailing list