Sign in to follow this  

Extraction XYZ and YPR from D3DXMATRIX

This topic is 4308 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

Hey all, I've been poking around with Direct3D for about a month now, and I'm wondering how you get the position (XYZ) and rotation (YPR) out of a compiled matrix. I have a rudimentary skeletal animation system which loads the mesh(es) and animation(s) out of a .x file, and then animates it. I've got an artist friend who's made a few models and given them to me to play with, but they're not all centered, so if I load two side by side one might be pointing left and the other one forward. What I want to do is get the root bone's transformation matrix, convert it to an identity matrix and copy the XYZ and YPR values into the world transformation matrix it uses, so everything starts pointing 'forward' and the root is centered at (0, 0, 0), although I don't know if it's a good idea to play with the positioning just yet. I've taken a quick peek into the SDK but I'm not finding the relevant information. I'm sure the information exists in it somewhere, but I can't find it. What I would greatly appreciate is if somebody could spell it all out for me (eg provide a simple function that takes a matrix and two D3DXVECTOR3 pointers and puts the apropriate information in them), because I'm a little new to this all. Thanks in advance, Todd

Share this post


Link to post
Share on other sites

This topic is 4308 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this