Math - Quaternion Rotation (Part 2)

In this lecture we looked at how to use quaternions to rotate a point in 3D space.

Quaternions are notorious for being quite difficult to understand, but hopefully the last few lectures have helped to demystify them.

Do you now feel more comfortable dealing with quaternions?

1 Like

Hey!

This is the first thing in the course that I have never actually heard of (or maybe someone mentioned it but no actual information). It is not an easy topic but I am happy to hear about these numbers too and I am looking forward to using them in practice while developing some games.
Although there is an error in the Quiz 19 I think, first of all the third question is the same as the fourth but I think the correct answer is also wrong. Shouldn’t the “the conjugate of the quaternion 4 + (1i + 2j + 3k)” be “4 - 1i - 2j - 3k” or “4 - (1i + 2j + 3k)” if we use the parentheses? The correct answer says “4 - (1i - 2j - 3k)”.
I would have written this comment for the quiz, not this lecture but I couldn’t find a way, so apologies for that.

Ji @verboben14, I’m glad to hear that your found quaternions interesting and learnt something completely new!

Most game engines use Quaternions to perform rotations under the hood, so you’ll definitely see the name popping up all over the place. Hopefully, you’ll now have a better understanding of what’s going on behind the scenes whenever you need to call these functions, rather than just having to use them blindly.

P.S. Thank you for pointing out the issue with the quiz question, I’ve now fixed this. The two answers you gave would be correct.

Hello, i did go through an example of rotating a vector using a quaternion and its conjugate.

I know this example is not the best one to take because v is a unit vector and represents the x axis while the angle of rotation is simply the y axis. But this seems to work so far :slight_smile: .
However im not 100% sure on this: During my first try i used i, j and k in every component of the vector when doing a vector operation. For example in the cross product i did something like this y1j * z2k - z1k * y2j. So k * j results in -i and so on. But this resulted in a wrong result compared to the rotation using the mat4. So i checked the “non-cross-product” version of the formula and i noticed that i, j and k are completely factored out. So is it correct that when we calculate q1 * q2 we can completly forget about the i, j and k?

I do have a further question about the w component of v’. Is there a case that this component does not equal to 0 when performing a rotation? And if thats the case how do we convert a quaternion back to a vec3 if w != 0?

1 Like

Hey Gary I was curious on how you can multiply a quaternion by a conjugate, I think I found the solution but what I basically do is: w+(-bi)+(-cj)+(-dk).
so for the quaternion of rotation it would be like : costheta/2+((-x)*sintheta/2i)+((-y)*sintheta/2j)+((-z)*sintheta/2k).
sorry if I did anything wrong or this is not a good practice

Privacy & Terms