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:
authorKen Hughes <khughes@pacific.edu>2006-07-26 16:34:56 +0400
committerKen Hughes <khughes@pacific.edu>2006-07-26 16:34:56 +0400
commit1df2871f2fa7d4d8f97e770c7cd0ab53f9014bfe (patch)
tree73acbcd9fabf8ccff2dd27c0d1dc594a4cdba0a4 /source/blender/python/api2_2x/Mathutils.c
parentf36fc4fe21ada143bf5cf28299b83173d61290b3 (diff)
===Python API===
Multiplication of 3D vectors by 4x4 matrices converts the vector to 4D but did not make the vector homogenous. Fixing that so the translation part of the matrix will also be applied.
Diffstat (limited to 'source/blender/python/api2_2x/Mathutils.c')
-rw-r--r--source/blender/python/api2_2x/Mathutils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/Mathutils.c b/source/blender/python/api2_2x/Mathutils.c
index cb2337ce941..1c48d517fa0 100644
--- a/source/blender/python/api2_2x/Mathutils.c
+++ b/source/blender/python/api2_2x/Mathutils.c
@@ -138,9 +138,9 @@ PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec)
if(mat->rowSize != vec->size){
if(mat->rowSize == 4 && vec->size != 3){
return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "matrix * vector: matrix row size and vector size must be the same\n");
+ "matrix * vector: matrix row size and vector size must be the same");
}else{
- vecCopy[3] = 0.0f;
+ vecCopy[3] = 1.0f;
}
}
@@ -202,9 +202,9 @@ PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat)
if(mat->colSize != vec->size){
if(mat->rowSize == 4 && vec->size != 3){
return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "vector * matrix: matrix column size and the vector size must be the same\n");
+ "vector * matrix: matrix column size and the vector size must be the same");
}else{
- vecCopy[3] = 0.0f;
+ vecCopy[3] = 1.0f;
}
}
size = vec->size;