Sign in to follow this  

NAN from D3DXMatrixDecompose()

This topic is 4590 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 guys, i'm using D3DXMatrixDecompose(); to get individual vectors for displaying user readable position/rotation/scale etc.. It works fine, I convert the quaternion to euler angles after I get it. When I start scaling the worldmatrix I pass to MatrixDecompose, the Quaternion starts to hold NAN for several values. Any idea why this is? (or any other stable function to decompose a matrix?)

Share this post


Link to post
Share on other sites
I had the same problems as you guys described above.

I assumed that following is allways true:

----NOT TURE----
D3DXMATRIX m;
m *= 0.0f;
----NOT TURE----
NAN * 0 = NAN

I thought souch a matrix will be filled by zeros. FALSE. X *= 0.0 != 0.0f.
In case memory allocated m contains values like NAN (happens very often) your multiplications will fail. Try to initialise everything before using it. If it sill does not work, the problem lies somewhere else - wrong values/function.

Hope it helps.

Share this post


Link to post
Share on other sites

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