This is one of my favorite talks so far: i finally learned why do we even use quaternions, that they are a possible alternative to matrices (which i kinda dislike), and finally the speaker has shown this cute azimuthal equidistant map projection implementation which will help me a lot with my own project. What a talk, thank You Todd.
I wrote the Quaternion shader library for a FAANG company, and still I found this to be a great and informative presentation where I learned some new things. Amazing presentation :D
@@hamish_todd I finished the talk and loved it. Really amazing how well you were able to communicate such a complicated topic in such an easily digestible way. Thank you for this!
@@lawrenceredmacher4382 w just answers "How much do we spin around the vector XYZ?" and that's laid out pretty early in the video, but really understanding what that means and why we use it is the remaining 40mins or so.
@@hamish_todd You showed how we are able to perform a translation using double quaternions and mentioned that they're used in Blender et al. Maybe you said this and I've missed it, but you're saying that if I make something move in a straight line in Blender, it's using a double quaternion under the hood to "rotate" around an axis that's infinitely far away? This talk has totally lit my mind on fire. I'll be piecing things together for at least the next few ways. It kinda feels like "Euler's identity over time", if that makes sense. Most explanations gloss over the fact that quaternions aren't really that useful for creating an instantaneous rotation, but one that occurs over time and the emphasis on interpolation made that click for me.
I just want to say Todd that you are so gifted at teaching, this video is a downright inspiration and a testament to the idea that there is no concept too difficult to teach! I am someone who has struggled with Quaternions for years and yet after this presentation it makes complete sense to me, I don't know what dark magic you are using over there but it is working. If you ever read this, I hope you have genuinely great day and that life is treating you well.
oh man, there was a time when I thought I wish there was a visual tutorial on Quaternions. Quaternion is such a bad boy. No interviewers ever dared to ask questions around that cuz they themselves are not confident how it works. Thank you so much for putting so much passion in this.
Wow great talk, I now realize I had almost come up with dual quaternions on my own once working in AR 3DOF for years, this really filled in some gaps though. It's a tricky topic to describe visually but the presenter made it all make as much sense as possible. I often use finding the from-to vector as essentially the same math, in concept, as from-to quaternions rotation, but I get a lot of funny looks when I do it, so at least I can now say, no I'm not just saying dark magic juju words and making weird finger gestures, there is a video!
Amazing talk, really helped me to understand quaternions, just starting my game dev career and i have to say, quaternions are something i need to get use to, but this certainly helped a lot.
Just show them some formulas for Pokemon stat calculations. If that doesn't work, follow it up with a detailed presentation on methods used for encountering or breeding a shiny Pokemon with perfect IVs. Be sure to detail all of the calculations and explain how multi-variable manipulation is absolutely essential in order to achieve the desired outcome. Then draw parallels between that and how your interest in videos game mechanics is actually congruent with their insistence on mathematical studies. They'll be begging you to play video games after that.
Playing games doesn't require complex math as it is shown here (there may be few exceptions I am not aware of). On the other hand, making your own game engines would definitely boost your math knowledge in certain areas.
@hamish_todd Am i on the right track here? I have a tidally locked rigid body on a circular orbit around the origin of the local coordinate system, i can represent that movement as a dual quaterion function of the position over time, where i move the center of rotation along the circular path (sin(r*t),cos(r*t),0) and also do a rotation "in the same (or similar in case of axial tilt) direction" to offset the rotation with a skrewniness so both happen once per orbit (keeping the /2 in mind)?
Humm, you've chosen a slightly difficult example to start with, but perhaps you are working with orbital dynamics? "dual quaterion function of the position" - I think you might have misunderstood, because the idea of dq's is that they do rotation *and* position. You may well want a dual quaternion that is a function of time. But you would be much less likely to want one as a function of position
@hamish_todd Let me clarify the relevant bit. I was a bit ambigious. I can represent the movement *and rotation* of that tidally locked planet as a dual quaterion function *defining* the position *and rotation* over time I do and did want a dual quaternion valued function over time. So the rest of my question remains the same. I do not work a lot with orbital dynamics. Having one body orbit another is just the easiest way to get a circular tidally locked movement i can think of. 😅
@@modernsolutions6631 Alrighty! We are picturing the earth and the moon. The earth is at the origin. The moon is, **before** we apply any transform, *also* at the origin, and our goal is to make a transform that will put it in the correct place and orientation, given time t. First, we translate it to a place in its orbit. It is "4" away from earth on average, in units of 100,000s of km. An example of a dual quat that'll translate 4 units in the x direction is 1+2e01. Why 2 instead of 4? Same reason as the angle-halving thing :) We now want to rotate the moon around the earth - it will stay tidally locked as we do so because it is as if we are rotating the moon and the line connecting the earth and the moon as a single rigid body :) An example of a rotation that'll do this is cos(pi/6) + sin(pi/6)*e13 - that'll rotate by pi/3 radians (because angle doubling again!). But hey, actually we want a function of time, so that's cos(t) + sin(t)*e13, so the time is the angle. Now, we *multiply those together*, because we want to move the earth to somewhere in the orbit and *then* rotate it. (cos(t) + sin(t)*e13) * (1+2e01) = cos(t) + sin(t)*e13 + cos(t)*2*e01 + sin(t)*e13*e01 (distributivity) = cos(t) + sin(t)*e13 + cos(t)*2*e01 + sin(t)*e30 (commuting e13 and e01 and using the fact that e1e1 = 1) And that's the answer :) apply that dual quat to the moon and itwill do the correct thing
I decided to follow this using UE5. While the initial rotations worked fine and are pretty straightforward, doing the Q addition doesn't yield a slanted object. FQuat q(0.f, 1.f, 1.f, 0.f); // Which should be the addition of FQuat(0.f, 1.f, 0.f, 0.f) + FQuat(0.f, 0.f, 1.f, 0.f) SetActorRotation(q); // All axis are aligned along X, Y and Z, not slanted.
A 180 rotation around the axis between (say) x and y will have this effect: it will swap x and y, and it'll send z to -z. So as you say, the axes are "aligned"! Unless I am misunderstanding you. Perhaps I shouldn't have chosen that example... try 0,0.8,0.6,0 instead. You'll see that that rotates the thing 180 degrees around an axis that is slightly closer to the axis that gets 0.8 than the axis that gets 0.6.
Is there any chance to get an access to software you're using for demos? I'd love to tinker around with quaternion values to understand them better :).
Good question! If it had been {w=0.5, z=0.5, y=0, x=0} instead of {w=0.7, z=0.7, y=0, x=0}... it would have changed nothing! Both of those are the same rotation. It also would have represented the same rotation if it was {w=0.01, z=0.01, y=0, x=0} or {w=999, z=999, y=0, x=0}. This is what I mean when I talk about the "amount of red paint and blue paint" thing. If you've got 0.5 red and 0.5 blue or 999 red and 999 blue, and you mix them, you always get purple. I could have chosen any number. So why did I choose 0.7? Because 0.7² + 0.7² ≈ 1, so if you have {w=0.7, z=0.7, y=0, x=0} it's a "normalized" quaternion. These are the "safest" ones to work with. In Unity, you *have* to work with them otherwise things go weird. Outside of unity, it's not super important, but it can be a good idea to keep to normalized quaternions for "numerical stability", which can avoid some obscure kinds of bug 🙂
Because sin/cos of 45 degrees is 0.707. He was incorrect to use 0.7. The full value is much longer, but still, seems like a cop-out to use "0.7". And "45" because it's θ/2, which means 90/2.
Also, on a unit circle (meaning the radius is 1), if you take a slice that's at 45 deg (with the angle being at the center of the circle)... the hypotenuse is 1. And the other two sides (representing sine and cosine) are both "1/(√ 2)", which is 0.707. The rounding down to 0.7 doesn't do anyone any good. I think 0.707 is as iconic as 0.866.
As a mathematician, I always find it weird to hear talks like this. In my head there is the geometry of the space, and I am just looking how they were implemented in the program (e.g. Quaternion, Euler angles, etc). Every time I hear such a talk, it always seems like there are 20 different objects, each one with weird properties that you need to remember, which are almost trivial once you know where they came from. But in general, great talk.
Nice. Didn't understand a thing. Things rotate, I guess. Thank god there are plugins, libraries and templates for these things. Made by people who understand this 😂
@@hamish_todd ah don't worry about it. I was a bit exaggerating. Sure I got the whole idea behind the rotations and the simple coordinate systems, but I couldn't resist making a bit of a low effort joke because all the details just fly over my head as a no-code designer. When you have premade extensions for most engines that handle this stuff for you, you end up not appreciating enough the fact that those are built by people who have the brain to understand the topic of your lecture in more detail.
Try to do multiple rotations in 3D without them and quickly bash your head through the wall with things not turning out as you intended. Quaternions are essential 3D math. It's like asking when you'd use vectors, while living in a world filled with vectors everywhere, every moment you're moving.
The candy wrapper effect demonstrates one of the uses. Another is avoiding something known as "Gimbal lock" which you can look up. Overall there are many advantages, just need to do some research on your end if you wish to pursue it, right?
32:06 Not true. You can apply a 4x4 matrix to all of them! A line is made up of 2 points, a quad is 4 points (the corners), and normals can be rotated by a 4x4 matrix too, if you set the .w component of the matrix to be zero (which makes the rotated vector a _directional vector_ instead of applying any translation to it - which is what a normal vector represents).
> a quad is 4 points Storing a plane as 4 points (even 3...) is extremely inefficient, no engine does things that way. The most common use for a plane is storing a normal, and normals are famously not transformed with 4x4 mats straight away, you take the inverse transpose (but you don't have to if you're storing a dual quat!) A line *might* be made of two points, or it could be in plucker coordinates so it's easier to take its distance/angle/intersection with things/get rotations around it. If you're storing it in plucker coordinates you want to transform it with a dual quat (or a 6x6 matrix which is a chore to calculate)
@@hamish_todd Sorry if I came off too mean... I've definitely seen worse presentations from GDC. Yours wasn't entirely awful. You absolutely CAN store a plane as 4 points, if you tell the rendering API to render it as a triangle fan. And you don't even need an index buffer to specify which corners belong to which triangle. In fact, you don't even need to store the points themselves (vertices), instead you can just "generate" them in the vertex shader. Or using a geometry shader, a mesh shader, or a compute shader.
No worries, it's the internet. But I think that the more you know about this stuff, the less you will stand by the things you have said as ways of mocking me. You are correct that you *can* store a plane as 4 points, but nobody does this - all game engines have a "plane" object, it is 4 floats x, y, z, d. If you want to transform it a plane (rotate and translate it perhaps), yes you *could* generate 4 points on its surface... in a geometry shader... then transform those points... and then I guess transform them back from your representation with 12 floats into the representation with 4 floats that everyone works with and that makes sense. It would be a round trip from the CPU to the GPU, be ridiculously complicated and horribly inefficient. But you *could* do it. Or, you could do it in like 20 FMADs, 6 lines of code with the existing method. Just requires you to say "not everything is a vec3".
Quaternions are actually 4D. This dude clearly does not know what he is talking about. The lecture itself is low quality in content and covers less than half of what could have been covered in 20 minutes. The "lecturer" is more interested in being controversial than passing on any useful knowledge. Waste of my precious time.
Yeah, he doesn't explain it at all... He just "did away" with "all that 4D stuff", which is actually kind of fundamental to how quaternions work. 😐 There's a scaling effect when you rotate, which he only mentions briefly in the Q&A at the end instead of being part of the actual presentation. Like, bruh... Come on. He left out a VERY important aspect of quaternions and where you could actually screw up trying to implement one. Instead of demystifying the black box, he just abstracted it more with "exp" and "log". At least that's how I see it. But only because I haven't looked into "dual quaternions". Some of the concepts were interesting, but the puppet play really put me off. And that "-1" thing with the elbow... Jesus Christ, that was weird. Maths don't have elbows! That only added to the confusion. A rotation GIF or video would have been sufficient. Or a click-drag interactive model - which is very easy to implement if he really is a "graphics researcher"!
I didn't say they weren't 4D, I said that saying "quaternions are 4D" is useless and damaging. If you were showing a kid how to make a salad with 4 ingredients, you could say to them "this salad is a point in 4D space". You wouldn't be wrong! But what you said wouldn't be helpful to anyone who wants to make a salad.
This is not theoretical at all I used this stuff for years everyday, this talk describes in hour what it took me 3 years to work out on my own in multiple projects in AR/VR in film and games
@@hamish_todd Lol, you still have the time to delete this comment. Sorry but this has to be the dumbest example you gave. Quaternion system has 4 numbers. 1 is real and the other 3(i,j,k) are imaginary/complex. Each of these numbers represent a particular point in their respective dimensions. It is indeed a 4D system. Everyone knows that except so called "experts" like you.
Math is short for mathematics; therefore, there is no sense in adding an ‘s, to a shortened form of a word in case you want to provide some context to your UK/Aussie mates lol
it's not plural, because no british person says "maths are my favourite subject". no one treats the full word as plural now that i actually think about it, "mathematics are my favourite subject" is wrong
You’re right that it’s not plural as mathematics encompasses a singular field of study. I didn’t mean to type so have edited to remove that one misplaced ‘plural, noting I’m traveling and listening to this. However, the adjective mathematic becomes a noun when adding the ‘s’ for mathematics. So, when you shorten mathematics to maths it was an incorrect interpretation of linguistics. Will it change in UK? No, as everyone here uses Maths
> "that 4D stuff", which is actually kind of fundamental to how quaternions work If you apply a quaternion to a vec4, there won't be any scaling effect. Which is to say, if you work in an actually "4-dimensional" way, that effect goes away, so I don't think you could say it is fundamentally 4D. >A rotation GIF or video would have been sufficient. Or a click-drag interactive model - which is very easy to implement if he really is a "graphics researcher"! The code editor with the cow (which can be clicked and dragged) was made by me. But any explanation of quats is incomplete without the "Dirac belt trick" (I prefer one's arm acting as the belt). Paul Dirac was one of the greatest physicists of all time, and when it came to talking about the double cover property (the technical term for this), he decided he needed to resort to a physical demonstration. People like physical demonstrations. So I put to you that, in some sense, math DOES or SHOULD have elbows!
Give me a chance! See what you think of the first few minutes. Like I say, it's not *false* to say quats are 4D. But it's no more accurate than saying 3x3 matrices are 9D. Everyone knows that the second statement would be a useless thing to say, but for some reason they don't apply the same logic to quats.
@@hamish_todd maaan ... it is such a bad decision to start a lecture like that, even antagonizing 3Brown1Blue and Numberphile. Not that I care too much about those channels, I actually dislike 3B1B. But it shows some lack of understanding about the what impress people, especially kids. I can totally agree that just saying "Quaternions ... 4 dimensional" is, let's say, not enough. A better statement would be "a 4 dimensional space that makes us understand 3 dimensional rotations" would be better, far better. You could even compare with the 9 dimensional space of 3×3 matrices, that are related to 3 dimensional rotations too. But just criticizing a valid statement AND two known and likable channels that make videos about the subject, is NOT a good idea at all. I don't know if I should watch your lecture. I will probably get more annoyed and will annoy you too.
Grant is a friend of mine and I know James too. I'm fully planning on sending this video to them (when the next one is released). Grant (and Ben, another acquaintance of mine who he made it with) wasn't completely satisfied with his quats explanation. I think that even your second statement, "a 4 dimensional space that makes us understand 3 dimensional rotations" is misleading. It's like saying "the space of bacon, lettuce, and tomato sandwiches, including bread, is a 4 dimensional space that makes us understand how to make lunch". Completely up to you whether you feel like watching lecture. I understand the reaction. But you won't know what you are disagreeing with unless you watch the first 25m (the rest is about dual quats, not as relevant)
@@hamish_todd well, we definitely disagree. Especially because I think that calling the statement I mentioned as "misleading" is very ... weird, given that quaternions were found because Hamilton wanted to represent algebraically 3D rotations in a similar way he already knew complex numbers represent 2D rotations. Loved your comparison though, about space of bacon, lettuce, etc. Hahahahahahaha. I really don't see any reason to avoid talking about the 4 dimensionality of quaternions and/or their historically justified relation with 3D rotations.
the whole purpose of quaternions is to rotate 3D objects without the issues you usually encounter with matrices, they have a very specific use for 3D and not 4D. i've never seen a single person using quaternions in 4D and that's not the point of it either way.
Simply the best explanation on quaternions I have ever seen.
This is one of my favorite talks so far: i finally learned why do we even use quaternions, that they are a possible alternative to matrices (which i kinda dislike), and finally the speaker has shown this cute azimuthal equidistant map projection implementation which will help me a lot with my own project. What a talk, thank You Todd.
I wrote the Quaternion shader library for a FAANG company, and still I found this to be a great and informative presentation where I learned some new things.
Amazing presentation :D
I'm in the first 5 minutes and this has already clarified quaternions better than anything else in the past 10 years.
Thank you!
I'm 7 minutes in and it's still all just x y and z which are just plain euler coordinates, still no explaining where the "w" comes in...
@@hamish_todd I finished the talk and loved it. Really amazing how well you were able to communicate such a complicated topic in such an easily digestible way. Thank you for this!
@@lawrenceredmacher4382 w just answers "How much do we spin around the vector XYZ?" and that's laid out pretty early in the video, but really understanding what that means and why we use it is the remaining 40mins or so.
@@hamish_todd You showed how we are able to perform a translation using double quaternions and mentioned that they're used in Blender et al. Maybe you said this and I've missed it, but you're saying that if I make something move in a straight line in Blender, it's using a double quaternion under the hood to "rotate" around an axis that's infinitely far away?
This talk has totally lit my mind on fire. I'll be piecing things together for at least the next few ways. It kinda feels like "Euler's identity over time", if that makes sense. Most explanations gloss over the fact that quaternions aren't really that useful for creating an instantaneous rotation, but one that occurs over time and the emphasis on interpolation made that click for me.
I just want to say Todd that you are so gifted at teaching, this video is a downright inspiration and a testament to the idea that there is no concept too difficult to teach! I am someone who has struggled with Quaternions for years and yet after this presentation it makes complete sense to me, I don't know what dark magic you are using over there but it is working.
If you ever read this, I hope you have genuinely great day and that life is treating you well.
applaud in front of my laptop, because you do deserve some applauds
Awesome explanation! Thank you so much!
oh man, there was a time when I thought I wish there was a visual tutorial on Quaternions. Quaternion is such a bad boy. No interviewers ever dared to ask questions around that cuz they themselves are not confident how it works. Thank you so much for putting so much passion in this.
Wow great talk, I now realize I had almost come up with dual quaternions on my own once working in AR 3DOF for years, this really filled in some gaps though. It's a tricky topic to describe visually but the presenter made it all make as much sense as possible. I often use finding the from-to vector as essentially the same math, in concept, as from-to quaternions rotation, but I get a lot of funny looks when I do it, so at least I can now say, no I'm not just saying dark magic juju words and making weird finger gestures, there is a video!
This was a great explanation of quaternions and dual quaternions. They finally make sense to me
This is probably the most useful GDC talk i've seen in a long time.
very long time
Very nice presentation! I wish there were some combination of this and Marc ten Bosch's "Let's remove Quaternions from every 3D Engine"
Amazing talk, really helped me to understand quaternions, just starting my game dev career and i have to say, quaternions are something i need to get use to, but this certainly helped a lot.
Ive only been programming for a year and Im following everything hes saying. Fantastic presentation here lmao
me explaining to my parents how playing games is just as constructive as studying math :
Just show them some formulas for Pokemon stat calculations. If that doesn't work, follow it up with a detailed presentation on methods used for encountering or breeding a shiny Pokemon with perfect IVs. Be sure to detail all of the calculations and explain how multi-variable manipulation is absolutely essential in order to achieve the desired outcome. Then draw parallels between that and how your interest in videos game mechanics is actually congruent with their insistence on mathematical studies.
They'll be begging you to play video games after that.
Playing games doesn't require complex math as it is shown here (there may be few exceptions I am not aware of).
On the other hand, making your own game engines would definitely boost your math knowledge in certain areas.
Great talk, great acrobatics, and the best explanation of quaternions ever presented to a programmer audience. Thanks Mr Todd.
😀 my students used to call me Mr Todd, you're triggering nostalgia. Thank you and have a nice day!
Very clearly explained, thank you !
@hamish_todd
Am i on the right track here?
I have a tidally locked rigid body on a circular orbit around the origin of the local coordinate system, i can represent that movement as a dual quaterion function of the position over time, where i move the center of rotation along the circular path (sin(r*t),cos(r*t),0) and also do a rotation "in the same (or similar in case of axial tilt) direction" to offset the rotation with a skrewniness so both happen once per orbit (keeping the /2 in mind)?
Humm, you've chosen a slightly difficult example to start with, but perhaps you are working with orbital dynamics?
"dual quaterion function of the position" - I think you might have misunderstood, because the idea of dq's is that they do rotation *and* position. You may well want a dual quaternion that is a function of time. But you would be much less likely to want one as a function of position
@hamish_todd
Let me clarify the relevant bit. I was a bit ambigious.
I can represent the movement *and rotation* of that tidally locked planet as a dual quaterion function *defining* the position *and rotation* over time
I do and did want a dual quaternion valued function over time. So the rest of my question remains the same.
I do not work a lot with orbital dynamics. Having one body orbit another is just the easiest way to get a circular tidally locked movement i can think of. 😅
@@modernsolutions6631 Alrighty!
We are picturing the earth and the moon. The earth is at the origin. The moon is, **before** we apply any transform, *also* at the origin, and our goal is to make a transform that will put it in the correct place and orientation, given time t.
First, we translate it to a place in its orbit. It is "4" away from earth on average, in units of 100,000s of km. An example of a dual quat that'll translate 4 units in the x direction is 1+2e01. Why 2 instead of 4? Same reason as the angle-halving thing :)
We now want to rotate the moon around the earth - it will stay tidally locked as we do so because it is as if we are rotating the moon and the line connecting the earth and the moon as a single rigid body :)
An example of a rotation that'll do this is cos(pi/6) + sin(pi/6)*e13 - that'll rotate by pi/3 radians (because angle doubling again!). But hey, actually we want a function of time, so that's cos(t) + sin(t)*e13, so the time is the angle.
Now, we *multiply those together*, because we want to move the earth to somewhere in the orbit and *then* rotate it.
(cos(t) + sin(t)*e13) * (1+2e01) = cos(t) + sin(t)*e13 + cos(t)*2*e01 + sin(t)*e13*e01 (distributivity)
= cos(t) + sin(t)*e13 + cos(t)*2*e01 + sin(t)*e30 (commuting e13 and e01 and using the fact that e1e1 = 1)
And that's the answer :) apply that dual quat to the moon and itwill do the correct thing
I have seen Hamish Todd give presentations before, really cool.
Great video! Though I wish you had more time to explain how each element of the Double-quaternion works.
I decided to follow this using UE5. While the initial rotations worked fine and are pretty straightforward, doing the Q addition doesn't yield a slanted object.
FQuat q(0.f, 1.f, 1.f, 0.f); // Which should be the addition of FQuat(0.f, 1.f, 0.f, 0.f) + FQuat(0.f, 0.f, 1.f, 0.f)
SetActorRotation(q); // All axis are aligned along X, Y and Z, not slanted.
I am pretty sure UE5 (and UNity) internally normalize the quaternions; have you logged the quaternion data just after init?
A 180 rotation around the axis between (say) x and y will have this effect: it will swap x and y, and it'll send z to -z. So as you say, the axes are "aligned"! Unless I am misunderstanding you.
Perhaps I shouldn't have chosen that example... try 0,0.8,0.6,0 instead. You'll see that that rotates the thing 180 degrees around an axis that is slightly closer to the axis that gets 0.8 than the axis that gets 0.6.
Make sure you are using Quaternions not Rotators.
In Blueprints, they have a different color and name
This was a new interesting topic to get into
Amazing presentation. Well done, @hamish_todd.
Is there any chance to get an access to software you're using for demos? I'd love to tinker around with quaternion values to understand them better :).
UA-cam won't let me put a link in here... it's "ed" on my github!
I need the second talk
Coming soon!
@hamish_todd is it soon yet?
@@nielsbishere Look for "quaternions to homogeneous points, lines, and planes"
@@nielsbishere UA-cam won't let me link directly to it but you should be able to find it!
@@hamish_todd yup, found it when it was posted
my mommy is letting me use the ipad today
You were barely 2
And it did ask the things we designed it to do
Now look at you
Same
"If you cannot build something with a concept you think you understand, you don't understand that concept." -
obligatory Geometric Algebra plug
3blue1brown
Why is the halfway rotation represented in w as 0.7 and not 0.5?
Good question!
If it had been {w=0.5, z=0.5, y=0, x=0} instead of {w=0.7, z=0.7, y=0, x=0}... it would have changed nothing! Both of those are the same rotation. It also would have represented the same rotation if it was {w=0.01, z=0.01, y=0, x=0} or {w=999, z=999, y=0, x=0}. This is what I mean when I talk about the "amount of red paint and blue paint" thing. If you've got 0.5 red and 0.5 blue or 999 red and 999 blue, and you mix them, you always get purple.
I could have chosen any number. So why did I choose 0.7?
Because 0.7² + 0.7² ≈ 1, so if you have {w=0.7, z=0.7, y=0, x=0} it's a "normalized" quaternion. These are the "safest" ones to work with. In Unity, you *have* to work with them otherwise things go weird. Outside of unity, it's not super important, but it can be a good idea to keep to normalized quaternions for "numerical stability", which can avoid some obscure kinds of bug 🙂
@@hamish_todd Thanks!
Because sin/cos of 45 degrees is 0.707. He was incorrect to use 0.7. The full value is much longer, but still, seems like a cop-out to use "0.7".
And "45" because it's θ/2, which means 90/2.
Also, on a unit circle (meaning the radius is 1), if you take a slice that's at 45 deg (with the angle being at the center of the circle)... the hypotenuse is 1. And the other two sides (representing sine and cosine) are both "1/(√ 2)", which is 0.707. The rounding down to 0.7 doesn't do anyone any good. I think 0.707 is as iconic as 0.866.
Such a great talk. You can really tell he was a middle school teacher. We need more of those and less "academics" in the videogame industry.
it's all differential geometry. beautiful, reality and simulated reality both.
As a mathematician, I always find it weird to hear talks like this. In my head there is the geometry of the space, and I am just looking how they were implemented in the program (e.g. Quaternion, Euler angles, etc). Every time I hear such a talk, it always seems like there are 20 different objects, each one with weird properties that you need to remember, which are almost trivial once you know where they came from.
But in general, great talk.
Nice. Didn't understand a thing. Things rotate, I guess. Thank god there are plugins, libraries and templates for these things. Made by people who understand this 😂
Oh, sorry to hear! Could you say where I lost you? Were you understanding the part with the 180s, where {x=1,y=0,z=0,w=0} is a 180 around the x axis?
@@hamish_todd ah don't worry about it. I was a bit exaggerating. Sure I got the whole idea behind the rotations and the simple coordinate systems, but I couldn't resist making a bit of a low effort joke because all the details just fly over my head as a no-code designer. When you have premade extensions for most engines that handle this stuff for you, you end up not appreciating enough the fact that those are built by people who have the brain to understand the topic of your lecture in more detail.
1 minute in and I'm lost.
P.S. i have a bachelor's in comp animation. 😂
Haha the 4D thing? The point of that slide is to say that quaternions are **not** 4D!
You realy should have started this talk with where would i use this stuff
All game engines 😁
Try to do multiple rotations in 3D without them and quickly bash your head through the wall with things not turning out as you intended.
Quaternions are essential 3D math.
It's like asking when you'd use vectors, while living in a world filled with vectors everywhere, every moment you're moving.
The candy wrapper effect demonstrates one of the uses. Another is avoiding something known as "Gimbal lock" which you can look up. Overall there are many advantages, just need to do some research on your end if you wish to pursue it, right?
support Gdevelop software
why is he hiding?
never expect i could see 3b1b in gdc rofl
32:06 Not true. You can apply a 4x4 matrix to all of them! A line is made up of 2 points, a quad is 4 points (the corners), and normals can be rotated by a 4x4 matrix too, if you set the .w component of the matrix to be zero (which makes the rotated vector a _directional vector_ instead of applying any translation to it - which is what a normal vector represents).
> a quad is 4 points
Storing a plane as 4 points (even 3...) is extremely inefficient, no engine does things that way. The most common use for a plane is storing a normal, and normals are famously not transformed with 4x4 mats straight away, you take the inverse transpose (but you don't have to if you're storing a dual quat!)
A line *might* be made of two points, or it could be in plucker coordinates so it's easier to take its distance/angle/intersection with things/get rotations around it. If you're storing it in plucker coordinates you want to transform it with a dual quat (or a 6x6 matrix which is a chore to calculate)
@@hamish_todd Sorry if I came off too mean... I've definitely seen worse presentations from GDC. Yours wasn't entirely awful.
You absolutely CAN store a plane as 4 points, if you tell the rendering API to render it as a triangle fan. And you don't even need an index buffer to specify which corners belong to which triangle. In fact, you don't even need to store the points themselves (vertices), instead you can just "generate" them in the vertex shader. Or using a geometry shader, a mesh shader, or a compute shader.
No worries, it's the internet. But I think that the more you know about this stuff, the less you will stand by the things you have said as ways of mocking me.
You are correct that you *can* store a plane as 4 points, but nobody does this - all game engines have a "plane" object, it is 4 floats x, y, z, d.
If you want to transform it a plane (rotate and translate it perhaps), yes you *could* generate 4 points on its surface... in a geometry shader... then transform those points... and then I guess transform them back from your representation with 12 floats into the representation with 4 floats that everyone works with and that makes sense. It would be a round trip from the CPU to the GPU, be ridiculously complicated and horribly inefficient. But you *could* do it.
Or, you could do it in like 20 FMADs, 6 lines of code with the existing method. Just requires you to say "not everything is a vec3".
Quaternions are actually 4D. This dude clearly does not know what he is talking about. The lecture itself is low quality in content and covers less than half of what could have been covered in 20 minutes. The "lecturer" is more interested in being controversial than passing on any useful knowledge. Waste of my precious time.
Theoretical stuff might matter more to you. But to so many others (including me) practical examples are way more useful
Yeah, he doesn't explain it at all... He just "did away" with "all that 4D stuff", which is actually kind of fundamental to how quaternions work. 😐 There's a scaling effect when you rotate, which he only mentions briefly in the Q&A at the end instead of being part of the actual presentation. Like, bruh... Come on. He left out a VERY important aspect of quaternions and where you could actually screw up trying to implement one.
Instead of demystifying the black box, he just abstracted it more with "exp" and "log". At least that's how I see it. But only because I haven't looked into "dual quaternions".
Some of the concepts were interesting, but the puppet play really put me off.
And that "-1" thing with the elbow... Jesus Christ, that was weird. Maths don't have elbows! That only added to the confusion. A rotation GIF or video would have been sufficient. Or a click-drag interactive model - which is very easy to implement if he really is a "graphics researcher"!
I didn't say they weren't 4D, I said that saying "quaternions are 4D" is useless and damaging.
If you were showing a kid how to make a salad with 4 ingredients, you could say to them "this salad is a point in 4D space". You wouldn't be wrong! But what you said wouldn't be helpful to anyone who wants to make a salad.
This is not theoretical at all I used this stuff for years everyday, this talk describes in hour what it took me 3 years to work out on my own in multiple projects in AR/VR in film and games
@@hamish_todd Lol, you still have the time to delete this comment. Sorry but this has to be the dumbest example you gave. Quaternion system has 4 numbers. 1 is real and the other 3(i,j,k) are imaginary/complex. Each of these numbers represent a particular point in their respective dimensions. It is indeed a 4D system. Everyone knows that except so called "experts" like you.
Math is short for mathematics; therefore, there is no sense in adding an ‘s, to a shortened form of a word in case you want to provide some context to your UK/Aussie mates lol
it's not plural, because no british person says "maths are my favourite subject".
no one treats the full word as plural now that i actually think about it, "mathematics are my favourite subject" is wrong
You’re right that it’s not plural as mathematics encompasses a singular field of study. I didn’t mean to type so have edited to remove that one misplaced ‘plural, noting I’m traveling and listening to this. However, the adjective mathematic becomes a noun when adding the ‘s’ for mathematics. So, when you shorten mathematics to maths it was an incorrect interpretation of linguistics. Will it change in UK? No, as everyone here uses Maths
@@boblobgobstopper13214 So what you're saying is there's actually no reason at all for saying "maths"?
+1 Point for America
f*rst
2:36 A computer graphics researcher explaining it using effing puppets. 😐 Jesus Christ. When there's a perfectly good computer right there.
> "that 4D stuff", which is actually kind of fundamental to how quaternions work
If you apply a quaternion to a vec4, there won't be any scaling effect. Which is to say, if you work in an actually "4-dimensional" way, that effect goes away, so I don't think you could say it is fundamentally 4D.
>A rotation GIF or video would have been sufficient. Or a click-drag interactive model - which is very easy to implement if he really is a "graphics researcher"!
The code editor with the cow (which can be clicked and dragged) was made by me. But any explanation of quats is incomplete without the "Dirac belt trick" (I prefer one's arm acting as the belt). Paul Dirac was one of the greatest physicists of all time, and when it came to talking about the double cover property (the technical term for this), he decided he needed to resort to a physical demonstration. People like physical demonstrations.
So I put to you that, in some sense, math DOES or SHOULD have elbows!
0:51 what a awful way to give a lecture. After this statement I realised this guy has nothing to intelectually offer me.
Give me a chance! See what you think of the first few minutes.
Like I say, it's not *false* to say quats are 4D. But it's no more accurate than saying 3x3 matrices are 9D. Everyone knows that the second statement would be a useless thing to say, but for some reason they don't apply the same logic to quats.
@@hamish_todd maaan ... it is such a bad decision to start a lecture like that, even antagonizing 3Brown1Blue and Numberphile. Not that I care too much about those channels, I actually dislike 3B1B. But it shows some lack of understanding about the what impress people, especially kids. I can totally agree that just saying
"Quaternions ... 4 dimensional"
is, let's say, not enough. A better statement would be
"a 4 dimensional space that makes us understand 3 dimensional rotations"
would be better, far better. You could even compare with the 9 dimensional space of 3×3 matrices, that are related to 3 dimensional rotations too. But just criticizing a valid statement AND two known and likable channels that make videos about the subject, is NOT a good idea at all.
I don't know if I should watch your lecture. I will probably get more annoyed and will annoy you too.
Grant is a friend of mine and I know James too. I'm fully planning on sending this video to them (when the next one is released). Grant (and Ben, another acquaintance of mine who he made it with) wasn't completely satisfied with his quats explanation.
I think that even your second statement, "a 4 dimensional space that makes us understand 3 dimensional rotations" is misleading. It's like saying "the space of bacon, lettuce, and tomato sandwiches, including bread, is a 4 dimensional space that makes us understand how to make lunch".
Completely up to you whether you feel like watching lecture. I understand the reaction. But you won't know what you are disagreeing with unless you watch the first 25m (the rest is about dual quats, not as relevant)
@@hamish_todd well, we definitely disagree. Especially because I think that calling the statement I mentioned as "misleading" is very ... weird, given that quaternions were found because Hamilton wanted to represent algebraically 3D rotations in a similar way he already knew complex numbers represent 2D rotations.
Loved your comparison though, about space of bacon, lettuce, etc. Hahahahahahaha.
I really don't see any reason to avoid talking about the 4 dimensionality of quaternions and/or their historically justified relation with 3D rotations.
the whole purpose of quaternions is to rotate 3D objects without the issues you usually encounter with matrices, they have a very specific use for 3D and not 4D. i've never seen a single person using quaternions in 4D and that's not the point of it either way.
39:20 So it was always rotation? 🌏🧎🏻🔫🚶🏻