Godot's Quaternion Variant is Beautiful (and misunderstood)

  Рет қаралды 8,272

SDG Games

SDG Games

Күн бұрын

In this video, we gaze beyond the third dimension as we understand the differences between Euler angles and Quaternion rotation.
I also go off on a weird tangent and tell my daughter a mostly true story about ancient mathematicians.
Part of my exploration of every Node and Variant in Godot.
For more details on quaternions, check out eater.net/quaternions
Source Code:
gitlab.com/lazy-tutorials/eve...
Itch Project:
Doesn't exist yet, but I'll make one if there's interest
00:00 Weird Intro
01:21 Less Weird Intro
03:11 Rotations in 3D Space
05:56 Euler to the Rescue!
09:11 Gimbal Lock
11:03 Quaternions
13:30 A little bit of math
14:22 Code Examples - Using Quaternions
17:40 Outro
#godot #godot4 #godotengine
Godot, Godot 4, Quats Quaternions, Euler, Math, seo is hard.

Пікірлер: 62
@SDGGames
@SDGGames 5 ай бұрын
Quick Corrections: 5:43 I was referring to the commutative property (I misspoke and said cumulative.) You can google "associative, commutative, and distributive" for more details on "basic" algebraic properties. But, yeah, some laws can break in higher dimensions.
@felicaamiko
@felicaamiko 8 күн бұрын
you spelled gimbal wrong sometimes, also in 16:19 you spelled quaternion with an extra n
@pruthweeshasalian3688
@pruthweeshasalian3688 Күн бұрын
@@felicaamiko "quanternion" is also how he pronounces it throughout the video
@dv_interval42
@dv_interval42 3 күн бұрын
Goddamnit. The gatekeepers have kept such a crazy simple concept behind "bro too complicated" doors.Thank you so much for clarifying this!
@fnkycoldmadeanr
@fnkycoldmadeanr 5 ай бұрын
"Genius is making complex topics simple" Thanks for making quaternions finally click for me 🤯
@jedikoops
@jedikoops 2 күн бұрын
ok but what if ur not a genius...
@red3tango
@red3tango 6 ай бұрын
Very well done explaining Quaternions, so wish I saw this video years ago. Would like to see a video with this type of explanation of Transform3D/Basis too. I know many solutions (and other engines) use Quaternions, however, Godot uses T3D/Basis "under the hood"; the inspector Euler angles are just for ease-of-viewing, and the Quaternion methods are wrappers that interact with the underlying T3D/Basis variant.
@SDGGames
@SDGGames 6 ай бұрын
Good catch! I'm working on a general Variant video now. I'm not sure if anything else will need to break out like Quaternions did, but I'll definitely be looking into T3Ds in more detail this week.
@GonziHere
@GonziHere 6 ай бұрын
a) really great tutorial. Saved for linking to others when needed. b) one of the great results of Quaternions is that you can lerp from one random rotation to another and it won't do something weird as it would with eulers.
@yvanvan3729
@yvanvan3729 6 ай бұрын
Great explanations, awesome tutorial. And icing on the cake, sources available on git ! Thank you for making this video. Have a wonderful day.
@awyeagames
@awyeagames 3 ай бұрын
Lol chatgpt being a waste of time is to be expected. Excellent video! I finally understood how to use quaternions in godot. Thank you!
@indoorraccoon4450
@indoorraccoon4450 5 ай бұрын
thank you so much! I loved every minute of it. Was trying at this for hours trying to find out how quaternions work in godot so your source code really helps
@weeknight74
@weeknight74 2 ай бұрын
Thanks for the video! I had been stuck on 3d rotations in Godot for a while and this video helped me understand the why my rotations weren't working as expected. Getting down to the physics of it was super useful.
@cherico94
@cherico94 5 ай бұрын
you are awesome! thank you so much for making this. I remember trying to understand quaternions so many times in the past and just give up and just use it cuz it "just works". You made it so easy for me to visualize it and understand it in under 20 minutes!
@AnnoyingNoisesProductions
@AnnoyingNoisesProductions Ай бұрын
Hey, thanks a lot! 👍 This really helped me get the random spread on my projectiles working.
@Zurpanik
@Zurpanik 5 ай бұрын
Excellent video and work! Fantastic reference! Thank you!
@MajikayoGames
@MajikayoGames 4 ай бұрын
Great vid. Good explanation that helped me understand gimbal lock and usage of quaternions in practice. You're right the 4D stuff about how they work is quite involved, will go watch the 3B1B vids if I ever have a need to understand their implementation.
@wulfrickwille3871
@wulfrickwille3871 6 ай бұрын
Good vid! Also looking forward to the Variant video :)
@JoLo-vx1nb
@JoLo-vx1nb 4 ай бұрын
Nice presentation on Quaternions.Can you tell me please what program you used to do your demo? I am trying to understand how quaternions function. The program you presented evidently has functions which compute the steps required. Access to your source code for your example would be much appreciated. I am not a programmer but am very much interested in comparing the Euler approach with the Quaternion approach when rotating objects. This is an excellent program to do this comparison ! ! The code would help me understand the math involved. THANK YOU !!!!
@RafaelRodrigues-jq6uc
@RafaelRodrigues-jq6uc 4 ай бұрын
dude this is the best tutorial ive seen thank you so much i can understand now!
@komronyusufjonov4022
@komronyusufjonov4022 6 ай бұрын
Well thats the best explanation of quaternions ) Thanks a lot )
@NewSchattenRayquaza
@NewSchattenRayquaza 5 ай бұрын
You have saved me hours of work thank you so much!
@fistnine1061
@fistnine1061 2 ай бұрын
Good useful. Thank you! 👍
@FuzzballStudios
@FuzzballStudios 5 ай бұрын
How was I not using this before? Thank you so much!
@nyeeesss2424
@nyeeesss2424 6 ай бұрын
That was really useful!
@jorgedavidcoronadoalonso6573
@jorgedavidcoronadoalonso6573 4 ай бұрын
Wow, you have a new follower, thank you for the explanation, I was not understanding why my rotation sometimes didn't work. I was searching a local rotation function 😂.
@shrippie-4214
@shrippie-4214 Ай бұрын
Nice will use them when I can
@lalalala99661
@lalalala99661 Ай бұрын
Thank you i guess now i understood very well explained
@Learning_For_Godot
@Learning_For_Godot 5 ай бұрын
I love your channel so much!! i just found it today and it's amazing
@SDGGames
@SDGGames 5 ай бұрын
Ooh, yeah. My script said communitive, but those long C words all jumble together sometimes!
@Myth_Maker_Forreal
@Myth_Maker_Forreal Ай бұрын
can someone explain how to apply this to a camera?
@prozacgodgamedev
@prozacgodgamedev 3 ай бұрын
Quaternions embody the phrase "Sit on it and spin!" - that's how I've always described them! haha
@a.j.outlaster1222
@a.j.outlaster1222 7 күн бұрын
I didn't even know what Gimbal Lock was before, Now I have a base understanding of quarternions. But I have a question, Wouldn't Euler XYZ be equivalent to Global ZYX?
@SDGGames
@SDGGames 4 күн бұрын
I'm not 100% sure what you mean by that. If you're talking about the Cartesian coordinate system, then yes, Godot uses Y as up instead of Z as up. Afaik, Godot is consistent internally, but other programs or equations might swap the axis.
@DevMarco-
@DevMarco- Ай бұрын
Where i job we've got quinoa buns. You wouldn't believe how hard it is for some people to pronounce quinoa. From Kinoya, to Kichinoa or my all time favorite Kinocchio I've heard so many funny names.
@SDGGames
@SDGGames Ай бұрын
So, how did I do? I used to say quan-tern-eeon, until I realized there was no "N' in the middle...
@trainzmarcel2074
@trainzmarcel2074 2 ай бұрын
this video is beautiful
@muuubiee
@muuubiee 2 ай бұрын
There were no planes when the mathmagician discovered quaternion, since that was something in the 1800's.
@kestrel77
@kestrel77 Ай бұрын
Does the look_at() function use a quaternion?
@SDGGames
@SDGGames Ай бұрын
I'm not sure what it uses under the hood, but that function sets the rotation directly on the node. You can see the final rotation expressed as a quaternion, but I think the actual data is stored as a Basis.
@4.0.4
@4.0.4 6 ай бұрын
So... The point of quaternions is that they make it easy to rotate around a vector, right?
@SDGGames
@SDGGames 6 ай бұрын
Yeah, at least that's the primary use in game engines specifically. Other fields might use them exclusively for expressing any rotation. There are some other ways of dealing with rotations in Godot that I'll cover in my next video.
@darklord8793
@darklord8793 20 күн бұрын
thanks man shit helped a lot
@JoLo-vx1nb
@JoLo-vx1nb 4 ай бұрын
SORRY !! I did not realize that Godot was a programming language and the source code was available. I have to learn Godot. I do not know how to execute the Quaternion program yet. If you could give me a quick procedure on how this is accomplished I would appreciate it. THANK YOU !!!
@SDGGames
@SDGGames 4 ай бұрын
Godot is a game engine, you can download it for free and run the scene in it. If you download the source code from the GitLab link in the description, you can play around with the quaternion demo scene. There is a lot of stuff that Godot does automatically, so I'm not sure how useful the code will be as an example for other languages. I did try uploading the project to Itch, but web support isn't quite there yet for Godot. I'll keep an eye on it and try to get the demo up when I can.
@JoLo-vx1nb
@JoLo-vx1nb 4 ай бұрын
THANK YOU !! I was able to run the source code.@@SDGGames
@DevMarco-
@DevMarco- 2 ай бұрын
One big hurdle in understanding the slightest bit about quaternions is the naming of the components of a quaternion. Naming three of the four components x y and z implies concepts that are nothing like anything you know so far
@LeoPartIsntCool
@LeoPartIsntCool 8 күн бұрын
but why normalze the 4d vektor? wouldn't it be much easyer to use with our 3d brains if we just keep it as a vektor and an angle instead of representing it as a 4d vektor?
@SDGGames
@SDGGames 8 күн бұрын
It's not really designed for mere mortals to understand. I think I linked the 3Blue1Brown video on the topic. We use it for math reasons, not for convenience. Euler angles are more convenient, until gimbal lock kicks in
@nicolaslanzoni9385
@nicolaslanzoni9385 2 ай бұрын
Ghin Baal L'qeh does sound ominous
@l.halawani
@l.halawani 2 ай бұрын
Mathemagician
@makebreakrepeat
@makebreakrepeat 5 ай бұрын
Ro ro rotate your owl 🎵
@boblako
@boblako 5 ай бұрын
Like and Subscribe! Great work 👍
@trickster721
@trickster721 3 ай бұрын
This is a good idea and structure for a video, but you're speeding up around the key points instead of slowing down. You should focus a little more on the specific information that you're trying to communicate, maybe with stricter editing. When you fiddle around and improvise with the demonstrations, it makes it difficult to follow the point you're trying to illustrate. If I had no concept of Gimbal Lock, I don't think that section of the video would clarify it for me, and that's supposed to be the main conflict of the story.
@SDGGames
@SDGGames 3 ай бұрын
Thanks for the feedback! This one was a bit of an experiment, but I'll keep your advice in mind in case I do another video like this
@sheepcommander_
@sheepcommander_ 5 ай бұрын
1:20 W
@SDGGames
@SDGGames 5 ай бұрын
It happens to the best of us... ¯\_ (ツ)_/¯
@RandomPickles
@RandomPickles Ай бұрын
I refuse to call Euler, OIL-er
@SDGGames
@SDGGames Ай бұрын
Yeah, I forgot to check. YOU'LL-er sounds like a Christmas drink to me, but it might be more correct
@RandomPickles
@RandomPickles Ай бұрын
@@SDGGames I think the way you prounounced it is the correct way. I just still refuse lol
@l.halawani
@l.halawani 2 ай бұрын
You must be doing something very wrong. You're videos are very right, top of the line. Really great content. But you must be doing something wrong to have only 5k views on a video like this, when the video itself is so good.
Every Variant in Godot 4
49:28
SDG Games
Рет қаралды 8 М.
Fantastic Quaternions - Numberphile
12:25
Numberphile
Рет қаралды 1 МЛН
CAN YOU HELP ME? (ROAD TO 100 MLN!) #shorts
00:26
PANDA BOI
Рет қаралды 36 МЛН
I accidentally made Blender in Godot
10:15
SDG Games
Рет қаралды 24 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,4 МЛН
Rotations in 3D Graphics With Quaternions
8:23
Manifolds in Maryland
Рет қаралды 5 М.
Euler vs Quaternion - What's the difference?
8:49
Class Outside
Рет қаралды 31 М.
10 mins GameDev tips - Quaternions
10:12
sociamix
Рет қаралды 103 М.
How to Use Quaternions
14:20
Positive Altitude
Рет қаралды 8 М.
💀💀 #brawl #gaming #games #supercell
0:20
GGg
Рет қаралды 6 МЛН
Baby Tvman Passes Mrbeast'S Test And The End 👍️
0:37
BigSchool
Рет қаралды 15 МЛН
HEROBRINE vs NIKOCADO AVOCADO Rank Up Challenge
0:20
Mazizien
Рет қаралды 8 МЛН
Take the Water Challenge: Good Family VS Bad Family
0:45
Realistic Craft
Рет қаралды 4,6 МЛН
Dynamike 1v3 Challenge 💣
0:38
Toodyxz
Рет қаралды 6 МЛН