beeemtee Posted March 3, 2011 Share Posted March 3, 2011 Hi everyone, is there a way to tell how the rotations expressed by two quaternions or 3x3 matrices relate to each other? Something like the dot product for vectors? ( if it make any sense It would drive some deformations on a character's shoulder. thanks mate Quote Link to comment Share on other sites More sharing options...
sanostol Posted March 3, 2011 Share Posted March 3, 2011 (edited) its just like with vectors from some inlinevop: $out = $quat[0]*$quat_1[0] + $quat[1]*$quat_1[1]+$quat[2]*$quat_1[2]+$quat[3]*$quat_1[3]; if the result is 1 it is in the same direction, 0 it means 180 degree, -1 360 degree.by taking the abs() of the result You get the differrence of the rotations. keeping the sign allows You to support rotationblending above 180 degree without flipping Martin Edited March 3, 2011 by sanostol Quote Link to comment Share on other sites More sharing options...
beeemtee Posted March 3, 2011 Author Share Posted March 3, 2011 Thanks a lot Martin! Quote Link to comment Share on other sites More sharing options...
Macha Posted March 8, 2011 Share Posted March 8, 2011 (edited) How exactly do quaternion dot products work? If we use the useful analogy of the first three components as the axis and the last as a rotation then I have some difficulty interpreting this. It's not at all clear that this is directly analogous to 3-vectors. If the quaternions are not normalized then the dot products will not be in the useful -1..1 range. But if we normalize it the angles will change too. So, what we really want is a normalized axis, whilst preserving the last component. Now, this appears to be the default vopsop quaternion node, but I am not sure why this would work for any quaternion in the shape of a 4-vector. Edited March 8, 2011 by Macha Quote Link to comment Share on other sites More sharing options...
sanostol Posted March 8, 2011 Share Posted March 8, 2011 i tend not to take the quaternion as a axis v that I rotate around with the value w, it does't fit that well. for example when You rotate around the axis z 360 degrees and the axis-rotation-value is right the quaternion compononents should only change in w keeping x the same, but that is not true, both values change. this is because the axis and angle are not written directly in the quaternion. quaternion = [cos(angle/2)(sin(angle/2)*vector) this is why the dot produkt is still working How exactly do quaternion dot products work? If we use the useful analogy of the first three components as the axis and the last as a rotation then I have some difficulty interpreting this. It's not at all clear that this is directly analogous to 3-vectors. If the quaternions are not normalized then the dot products will not be in the useful -1..1 range. But if we normalize it the angles will change too. So, what we really want is a normalized axis, whilst preserving the last component. Now, this appears to be the default vopsop quaternion node, but I am not sure why this would work for any quaternion in the shape of a 4-vector. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.