#### Archived

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

# Rotation matrix question...

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

## 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 on other sites
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 on other sites
Yes they were normalized... Thanks for the idea anyways.

##### 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.

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633678
• Total Posts
3013290
×