Page 1 of 1

Can I add two matrix's rotation angle to transform a vector?

Posted: Thu Jun 02, 2016 2:07 pm
by Tonytonytang
There are two matrix, matrixA(rotation(X1, Y1, Z1)), matrixB(rotation(X2, Y2, Z2)), and matrixC setRotationAngle((X1 + X2, Y1 + Y2, Z1 + Z2)), then finally matrixC.transformVector(VectorV) to get a vector rotation result? Suppose matrixA and matrixB have same translation and scale primitives, so does matrixC. I did like that, but the result seems incorrect. Thanks.

Re: Can I add two matrix's rotation angle to transform a vec

Posted: Thu Jun 02, 2016 2:28 pm
by devsh
No, you most probably want to apply rotation B after rotation A.... so multiply the matrices together

Re: Can I add two matrix's rotation angle to transform a vec

Posted: Thu Jun 02, 2016 2:34 pm
by Tonytonytang
devsh wrote:No, you most probably want to apply rotation B after rotation A.... so multiply the matrices together
Yeah, that's exactly what I want, thanks dude, I'll try it tomorrow.

Re: Can I add two matrix's rotation angle to transform a vec

Posted: Fri Jun 03, 2016 11:49 am
by Tonytonytang
devsh wrote:No, you most probably want to apply rotation B after rotation A.... so multiply the matrices together
That works perfect :D thank you