[Closed] How to convert Max's transform matrix to Maya's trans. matrix?
Hi there,
EDIT: I figured it out, so, you don’t have to answer here, but if you’re interested to know, read my second post. Thanks anyways for your attention
I’ve been recently doing some conversion stuff between Max and Maya and I bumped into a problem I can’t seem to solve.
I need to translate (meaning convert) a Max’s transform matrix into Maya’s. The problem isn’t in the matrix itself, I understand that and I’m able to communicate matrices between Max and Maya, the problem is the “Y UP” axis in Maya (or rather the “Z UP” axis in Max). What is the process I need to take in order to “rotate” the world coord sys along the positive X axis before exporting the matrix so that Maya understands it?
Or is it something even more complex than this?
First thing I tried was inverting the matrix from Max and loading it in Maya. It worked, the object was oriented the same in space, however, the X and Z axises were of opposite values (i.e.: not 90deg but -90deg). Is this the way? Or am I completely off the track here?
Thanks a lot in advance, cheers,
- loocas
Hi loocas,
I’m not completely sure about your needing, since I don’t know Maya world coordinate system, but if you want to rotate a matrix in Max about its X axis you can use this:
matrix3 *= rotateXMatrix 90 -- Angle in degrees
I hope this helps
Nope, it’s not the rotation of the matrix actually, I just found the solution, it’s the xForm of the matrix.
More concretely it’s this forumla (Max to Maya!):
(matrix3 [1,0,0] [0,0,1] [0,-1,0] [0,0,0]) * transform_matrix3 * inverse(matrix3 [1,0,0] [0,0,1] [0,-1,0] [0,0,0])
Anyways, thanks for your help, mate.
One last note, I don’t know whether that’s an issue regarding cameras only, yet, but especially for the cameras, you’ll need to preRotateX by negative 90 degrees the input matrix in Max before you convert it to Maya’s matrix!
The reason is that Maya’s camera has a different default rotation to Max’s.
Thanks for posting Loocas, that’s a nice tidy function
You’re correct about the camera – it had me stumped for ages on a similar project. It’s actually because the local axis is different to standard objects (it looks down its Z axis, not its X axis … or is it the other way round!? One of them anyway)
More info here: http://forums.cgsociety.org/showthread.php?f=98&t=608589&highlight=y-up+z-Up