Jump to content
  • Advertisement

Archived

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

spg

Rotation matrix question...

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

Ok here''s my goal: I have a model which I''m playing through 2 animation sequences. At the end I want to check to make sure that the rotation on each bone is close to equal at the end of animation A and at the beginning of animation B (to prevent some pops). Basically I need two rotation matrices to be within a threshold of each other. So what I did was take the X, Y, and Z vector within each rotation matrix (column 0, 1, and 2) and then did something similar to this: acos(vector1x.dot(vector2x)) This should give me the difference between the angles in radians, correct? It seems to be giving me bad data. Do you guys know of a problem with this method or some way I might have messed up? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
are vector1x and vector2x both unit vectors? If so, it should work fine. Because then you''re taking the arccos of a number that can range between -1 and 1

But if their dot product could be outside that range, arccos doesn''t make any sense. So if the mangnitudes of vector1x and vector2x aren''t BOTH 1, normalize them before you dot them.

Share this post


Link to post
Share on other sites
hmm...have you tried acos(...) on some constants like 1, 0.5, 0, that kind of thing? Just to make sure that it returns what you think it does, in the proper form or whatever.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!