Appropriate multiplication of matrices for rotation/translation

It looks like the problem is:

Matrix.multiplyMV(GLES20Renderer._uBodyCentreMatrix, 0, GLES20Renderer._ModelMatrixBody, 0, GLES20Renderer._uBodyCentre, 0);

Matrix.multiplyMV is a method to multiply a 4 element vector by a 4×4 matrix and store the result in a 4 element column vector. In matrix notation: result = lhs x rhs. The resultVector element values are undefined if the resultVector elements overlap either the lhsMatrix or rhsVector elements.

I don’t think you posted all the code so I can’t check for sure, but judging by your naming of ‘_uBodyCentreMatrix’ you are probably encountering an error because it is not a 4 element column vector.

I’m assuming that ‘_ModelMatrixBody’ is a 4×4 matrix and ‘_uBodyCentre’ is a 4 element vector, otherwise these could be problematic as well.

Leave a Comment