glSmurf 216 Report post Posted March 11, 2007 How do I compute the angular velocity of an rigid body given only its rotation matrix in the current and previous frame? Thanks in advance 0 Share this post Link to post Share on other sites
johdex 247 Report post Posted March 11, 2007 If M0 and M1 are your rotation matrices in the previous and the current frame, then they are related by:R*M0 = M1 (1)where R is a rotation matrix.From (1), you get that R = M1*transpose(M0)From http://en.wikipedia.org/wiki/Rotation_matrix:R(0,0) + R(1,1) + R(2,2) = 1+2*cos(w) (3)where w is the angle of the rotation, divide it by your delta, you get the angular velocity.There is one problem though, the number of solutions to (3) is infinite, which means that strictly speaking, it's impossible to do what you are trying to do. In practice, I guess you can assume that abs(w) is small, so you can choose the smallest solution. 0 Share this post Link to post Share on other sites
glSmurf 216 Report post Posted March 11, 2007 Thanks for the replyThat did help me alot with what im trying to do, but to completely solve my problem I also need the axis of this rotation (this is in 3D btw) 0 Share this post Link to post Share on other sites
johdex 247 Report post Posted March 11, 2007 I just found another article on wikipedia which will help you, see section "Log map from SO(3) to so(3)".The formula is:w = 1/2sin(theta) * [R(3,2)-R(2,3); R(1,3)-R(3,1); R(2,1)-R(1,1)]I have not checked the it, but I suspect an error in their formula. It's surprisingly almost symmetrical, but not quite... I wonder if the last R(1,1) should read R(1,2)? 0 Share this post Link to post Share on other sites
glSmurf 216 Report post Posted March 11, 2007 Thanks again! You were right about that error. It should be R(1,2), not R(1,1). 0 Share this post Link to post Share on other sites