Jump to content

Difference of rotations


beeemtee

Recommended Posts

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

Link to comment
Share on other sites

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 by sanostol
Link to comment
Share on other sites

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 by Macha
Link to comment
Share on other sites

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.

post-1071-129957942188_thumb.jpg

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...