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

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
Tonytonytang
Posts: 7
Joined: Tue May 31, 2016 9:01 am

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

Post 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.
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

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

Post by devsh »

No, you most probably want to apply rotation B after rotation A.... so multiply the matrices together
Tonytonytang
Posts: 7
Joined: Tue May 31, 2016 9:01 am

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

Post 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.
Tonytonytang
Posts: 7
Joined: Tue May 31, 2016 9:01 am

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

Post 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
Post Reply