Jump to content
  • Advertisement
Sign in to follow this  
BaSSraf

NAN from D3DXMatrixDecompose()

This topic is 4835 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
Advertisement
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
Sign in to follow this  

  • 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!