Rotational Matrix3 and Quaternion

   1313   2   1
User Avatar
Member
37 posts
Joined: April 2022
Offline
The pig head has some rotational movement from position A to B as shown in my attached pic.

(Pivot point remains at {0,0,0} with no translation or rotation)




In order to the get the degrees for such rotation, I have the following:



// Method 1. Matrix only:
matrix3 offset = invert(A) * B;
vector Rot = cracktransform(0, 0, 1, 0, offset);


// Method 2. Convert to quaternions for calculation:
vector4 A = quaternion(A);
vector4 B = quaternion(B);
vector4 offsetQ = qmultiply(A, qinvert(B));
vector Rot = qconvert(offsetQ);



I was expecting the same result for Rot, unfortunately not.

There must be something somewhere I misunderstood. Someone explain to this noob, please?
Edited by sda502 - Oct. 17, 2022 05:13:10

Attachments:
Screen Shot 2022-10-17 at 14.39.04.png (969.4 KB)

User Avatar
Staff
745 posts
Joined: Oct. 2012
Offline
qconvert() returns an angle/axis vector, where the vector's direction is the axis and the magnitude is the rotation around that axis

You might be looking for quaterniontoeuler() instead?
User Avatar
Member
37 posts
Joined: April 2022
Offline
I am perplexed.
  • Quick Links