Page 1 of 1

Multiplying matrixes for child objects

Posted: Sat Jun 07, 2014 5:12 am
by deltic009
So.......

I have my decal how I want it in the sim, with the exception of needing to scale it a bit and rotate it through 90 degrees too.

So for the scaling matrix I have:
[2.25 0 0]
[0 2.25 0]
[0 0 1]

The rotation matrix I require is for a 90 degree rotation clockwise, which is:
[0 0 1]
[0 1 0]
[-1 0 0]

However, when i multiply them together and input my resulting matrix to the .bin file, I lose scaling in one axis but the object rotates exactly how I desire. The result matrix I have (which may of course be totally wrong) is:
[0 0 0]
[0 2.25 0]
[-1 0 0]

Please, could someone help rescue me from trig calculations and insanity.

Thank you.

Re: Multiplying matrixes for child objects

Posted: Sat Jun 07, 2014 7:26 am
by JLD95
Hi

Matrix result is:
[0 0 2.25
0 2.25 0
- 1 0 0]

Re: Multiplying matrixes for child objects

Posted: Sat Jun 07, 2014 10:47 am
by deltic009
JLD95 wrote:Hi

Matrix result is:
[0 0 2.25
0 2.25 0
- 1 0 0]
Okay, thanks for your help. If you know any easy tutorials or can explain easily where I went wrong that would be great. As always, once I know I know, but when I don't know I get very cross.

Re: Multiplying matrixes for child objects

Posted: Sat Jun 07, 2014 11:16 am
by Kernow2
This has worked for me on the very few times I've investigated matrices..
http://www.mathsisfun.com/algebra/matri ... lator.html
Just tried your example it it worked ok!
Why not give it a try?
Regards,
Kernow2/Graham

Re: Multiplying matrixes for child objects

Posted: Sat Jun 07, 2014 6:26 pm
by scefhwil
Interesting thread! Have pondered about how to do this with child objects but never got around to it. So, how does the resultant 3x3 matrix get translated into the 4x4 in the blueprint?

Re: Multiplying matrixes for child objects

Posted: Sat Jun 07, 2014 6:40 pm
by deltic009
scefhwil wrote:Interesting thread! Have pondered about how to do this with child objects but never got around to it. So, how does the resultant 3x3 matrix get translated into the 4x4 in the blueprint?
The 3x3 is just numbers that go into positions 1,2,3,5,6,7,9,10,11 in the 4x4 matrix. The 3x3 is in the top left corner of the 4x4.

Re: Multiplying matrixes for child objects

Posted: Sun Jun 08, 2014 4:42 pm
by scefhwil
Quite simple then. Thanks.