Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Arcibald Wearlot

Converting a matrix to a different coordinate system

This topic is 5171 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm writing a model exporter for 3d studio max 6. This program uses a right handed coordinate system, plus it swaps the Y and Z axes (the Z axis is pointing up, the X right and the Y into the screen). It was quite easy to export the vertex data, i just swapped the y and z coordinates, negated the z coord and inverted vertex order in a triangle. Now i'm trying to export the transform matrices of the bones. Max uses 4x3 matrices, so i suppose it is storing transformations the same way as DirectX (i don't remember how this is called, row-major? column-major?), that is the last row holds the x, y and z translation, so it would be easy to convert those, but i have no idea of how to convert the rotations.. anyway the Max SDK's Matrix3 class has some useful functions to retrieve the translation and rotations, such as GetYawPitchRoll(), so i can directly access to the rotation angles, but yet i have no idea on how to convert them. Any help would be greatly appreciated edit: maybe i had to post this in the math forum? [edited by - Arcibald Wearlot on May 17, 2004 1:34:03 PM]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Instead of "swapped the y and z coordinates, negated the z coord", figure out the equivalent 4x4 transformation matrix (hint: it''s a rotation). If we call that M and the bone transformation B, then I believe that the transformation becomes M<sup>-1</sup>BM.

Share this post


Link to post
Share on other sites
Use the IGameExporter interface, available from sparks.discreet.com. It makes exporters Really Simple (tm) and has a bunch of coordinate system modes already built-in.

The Cx format and exporter has a sample exporter that actually does something as opposed to the Discreet example. However, it''s for Max 5.1; dunno how much changed with Max 6.

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Instead of "swapped the y and z coordinates, negated the z coord", figure out the equivalent 4x4 transformation matrix (hint: it's a rotation). If we call that M and the bone transformation B, then I believe that the transformation becomes M<sup>-1</sup>BM.


hmh, i dont think i understand what you mean

quote:
Original post by hplus0603
Use the IGameExporter interface, available from sparks.discreet.com. It makes exporters Really Simple (tm) and has a bunch of coordinate system modes already built-in.

The Cx format and exporter has a sample exporter that actually does something as opposed to the Discreet example. However, it's for Max 5.1; dunno how much changed with Max 6.


Yeah it's some time that i use the IGame interface, it really got anything a lot easier. It automatically computes the normals! before of using it, i had to manually interpolate them using smoothing groups and blah blah blah. I got it working, and it was perfectly useless as the day after I discovered IGame
Anyway I didn't know of the coordinate system modes you are mentioning..
Is there some sort of documentation? Im just using the headers for now.
I just looked on sparks: there are only the japanese documentation (-_-') and an introduction to IGame, but i have to be registered to download it.

[edited by - Arcibald Wearlot on May 19, 2004 4:43:16 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!