Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2009-09-08 02:26:23 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2009-09-08 02:26:23 +0400
commit0ab2f675c364f2ca1212b0453bf2ffdce5ebb9ea (patch)
tree250bc6c6009f27fa1dcaf450dca6b50eb7cc7b3f /source/blender/editors/transform/transform_orientations.c
parent01eaf4fd5f674858281a253e0a0150d3f44ee325 (diff)
Fix bug in Mathutil with matrix/matrix and matrix/vector multiplication order.
MathUtil matrix type follows Blender convention of column major storage. This means that the elements on one column are contiguous in memory. Vectors are one dimensional arrays that can be considered in row or in column but the Blender convention is column so vector should only be considered as row. This means that the only logical multiplication operation between matrix and vector is matrix * vector. This convention is respected in all parts of MathUtil except in matrix/matrix and matrix/vector multiplication where the row major convention is assumed, which in the and is equivalent to reversing the order of multiplication. This is clearly a bug and must be corrected but the side effect is that it will break all scripts using these operations. Script writers who care about the correctness of the matrix operations have already implemented work around: 1) change order of matrix/vector multiplication. vec2 = vec1 * mat1 This must be changed to the normal order: vec2 = mat1 * vec1 2) change order of matrix/matrix multiplication (with matl a local transform in matw reference) mat3 = matl * matw This must be changed to the normal order: mat3 = matw * matl 3) transpose before an after the multiplication matl.transpose() matw.transpose() mat3 = matw * matl mat3.transpose() This must be changed to: mat3 = matw * matl;
Diffstat (limited to 'source/blender/editors/transform/transform_orientations.c')
0 files changed, 0 insertions, 0 deletions