Matrix - Looking for help or any documentation

Hello everyone,

I’m new over here and I’m not very good with code, cause I’m coming fro 2D animation. Hope it4s gonna be clear.

I have some difficulty to find/understand how the matrix is build in maya. I
I have found some documentation about the pyhton matrix

But it seems that the matrix in maya is not exactly build the same way. If you have a link to doc, or an explanation it would be wonderful! I need this to update a plugin for an other soft, that send info to Maya and Blender.

In the meantime I have tested all the value and made my own data-sheet. cf picture
The red values are the place where something’s missing.

Below the sheet, there is some picture of my attemps, sorry I write them in french.

  1. some random value and the matrix coresponding

  2. when I change values around the X axes, the value in matrix change except on the X line, it is what I expect.

  3. when I change the values around Y axes, all the value change even in the Y line of the matrix, wich is weird.

  4. Then when I change the value around Z axes, the value of X and Y lines changes in the matrix, and the first to value of the Z line is changing too.

I am probably missing something, since I don’t really know coding or python, so If you can help me or point into a direction, I would be very grateful !!!

Thank you very much

The vectors in a matrix do no directly correspond to the rotation values you see in channel boxes.

  • Matrix rotation vectors are normalized, so the total of all values in the vector == 1.0
  • Matrix values have no concept of how many times something has been rotated more than 360 degrees
  • The channel box shows key frame values in the current objects space. For rotation these values are in degrees.
  • Matrix values are in parent space
  • The channel box values are computed down and represented by the matrix under the hood, this way you can work with values that are easy to understand.

This is a good collection of videos to help explain maths in maya ( it applies to most dccs ):

So… your rotation matrix cheat sheet is wrong. Here’s the correct values

rotate X matrix
|  1       0       0       0 |
|  0       cos(x)  sin(x)  0 |
|  0      -sin(x)  cos(x)  0 |
|  0       0       0       1 |

rotate Y matrix
|  cos(y)  0      -sin(y)  0 | 
|  0       1       0       0 |
|  sin(y)  0       cos(y)  0 |
|  0       0       0       1 |

rotate Z matrix
|  cos(z)  sin(z)  0       0 | 
| -sin(z)  cos(z)  0       0 |
|  0       0       1       0 |
|  0       0       0       1 |

Try starting from zeroed rotations and changing Z then Y then X in that order. Makes a bit more sense, right? Order matters for this. If you turned left then walked forward, you’d end up in a different place than if you walked forward then turned left.

Here’s something to try: Make 3 locators, and name them “X”, “Y”, and “Z”
Now parent them so that Z is the parent of Y which is the parent of X.
Now try rotating these objects. But for the X object, you can only change the x value, the Y object only the y value, and the Z object only the z value. This is a good illustration of what’s happening.

Sorry, gotta be nit-picky here. The total of the squares of all the values in the vector == scale squared. It’s the Pythagorean theorem.

1 Like

Ok thanks, it’s a lot of very helpful informations. Even if i’m not near to solve my problem, all the informations are very interesting.

Ok very interesting, and it explain why the euler values in channel box are not suited to build the matrix. It help me to understand how everything is functionning.

Ok. I realise that I forget to say that I’m looking for the World Matrices of my object.

I’m going to dig deeper on my own with those new informations, and then maybe I’ll be back to ask you some more questions.

Thanks a lot for the tips and for your time !