# How to convert Max's transform matrix to Maya's trans. matrix?

 05 May 2008 loocas czech me out!   portfolio Lukáš Duběda CEO, Lead TD duber studio™ Praha, Czech Republic 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 __________________ - Lukáš Duběda | ADVERTS s.r.o. | duber's blog Last edited by loocas : 05 May 2008 at 12:20 PM. share quote
 05 May 2008 SyncViewS IC.Developer   Enrico Gullotti Technical Artist and Programmer United Kingdom 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 __________________ IllusionCatalyst – Instrument set for 3ds Max │ AliquaForma – Personal portfolio in fieri share quote
 05 May 2008 loocas czech me out!   portfolio Lukáš Duběda CEO, Lead TD duber studio™ Praha, Czech Republic I figured it out Originally Posted by SyncViewS: 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. __________________ - Lukáš Duběda | ADVERTS s.r.o. | duber's blog share quote
 05 May 2008 loocas czech me out!   portfolio Lukáš Duběda CEO, Lead TD duber studio™ Praha, Czech Republic 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. __________________ - Lukáš Duběda | ADVERTS s.r.o. | duber's blog Last edited by loocas : 05 May 2008 at 01:36 PM. share quote
 05 May 2008 davestewart Repeat-customer   Dave Stewart Animator / scripter United Kingdom 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/showthr...light=y-up+z-Up __________________ Portfolio | Keyframes and Code share quote
 05 May 2008 CGTalk Moderation Expert Thread automatically closed This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum. __________________ CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. share quote

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.