Euler (gimbal lock) Explained

Поделиться
HTML-код
  • Опубликовано: 30 сен 2024
  • In this video we explore Euler Rotations, the most common method for orienting objects in 3d. It's by-product "gimbal lock" can cause headaches for animators because the animated motion can move in strange ways. Here we learn how euler's "rotation order" is a bit like hierachies, and how changing this order can help us to avoid gimbal problems. This is demonstrated with a solution to a common camera problem, by finding the correct rotation order.

Комментарии • 780

  • @carykh
    @carykh 3 года назад +1362

    Despite being made almost 10 years earlier, this video is a great follow-up to 3blue1brown's video on "Quaternions and 3d rotation"! I was curious about why gimbal lock was such a problem for Euler rotation, but this describes it perfectly

    • @lexsec
      @lexsec 3 года назад +9

      Nice to see you here! And yeah, I want to see more treasure like this on RUclips...

    • @not.play.genshin
      @not.play.genshin 2 года назад +5

      So basicly the axis have to be in such an order that the gimble lock doesn't hapen in an real environment

    • @Jachii9
      @Jachii9 2 года назад

      oh hi cary didnt expect you here

    • @rogervanbommel1086
      @rogervanbommel1086 2 года назад

      I also saw them in that order

    • @MR-nl8xr
      @MR-nl8xr Год назад

      Yea, I think I am starting to get it.

  • @TentoesMe
    @TentoesMe 5 лет назад +1021

    Oh, THAT's why that didn't work 30 years ago! At university, studying computer science, I was doing some recreational programming one night trying to make a flying game, but whenever the plane got vertical, strange, physically impossible things happened. I always meant to revisit that and try to figure it out. (Was writing in pascal for PC)

    • @FatalNFlawless
      @FatalNFlawless 4 года назад +41

      That's one of the few situations this happens with. It also occurs when map building and wanting and object at a specific angle, that is be gimble locked out. Also causes issues with physics. Adding a 4th ring (almost like a locked 4th dimension) can fix the issue. Imagine the object gets stuck at an angle b/c of gimble lock and you basically spin the world around it haha.

    • @Seedonator
      @Seedonator 4 года назад +22

      Lol dude I'm here because I'm making a jet in Unreal Engine 4 and it spazzes out when it looks directly up or down.

    • @pavelperina7629
      @pavelperina7629 4 года назад +2

      @@kirkhamandy Quaternions won't help. Advantage of Euler angles is that you can make mechanical device that sets all the angles to orient something in space. For example camera.

    • @FatalNFlawless
      @FatalNFlawless 4 года назад +1

      @@kirkhamandy I have haha. I couldn't remember what they were called though, so I tried to give the best explanation I could.

    • @jeffborders5526
      @jeffborders5526 4 года назад +8

      No you need 13 rings to gimble lock and then it opens a portal to hell.

  • @robosergTV
    @robosergTV 8 лет назад +505

    best explanation on the internet about gimbal lock thx

  • @somon90
    @somon90 4 года назад +137

    I went on a journey to figure out what happened to the presenter in this video in the ten years after he made this. Apparently he went on to work on Avatar and Gravity.

    • @r.u.s.e3586
      @r.u.s.e3586 4 года назад +16

      Thats freaking cool

    • @r.u.s.e3586
      @r.u.s.e3586 3 года назад +2

      @@gerrardsoutham2841 If I could afford it I would totally take that course holy crap.

  • @JoJoJet100
    @JoJoJet100 9 лет назад +1101

    oh, so that's why Unity uses quaternions. I still hate quaternions, but at least I know why.

    • @IGameChangerI
      @IGameChangerI 8 лет назад +100

      +Steven Quaternions are much more intuitive when you understand how it works. Someone compared it to mixing colors. In stead of using blue and red to create purple, you're using x and z to create a new rotation.

    • @programagor
      @programagor 8 лет назад +69

      +Steven What's wrong with quaternions? It's a beautiful algebra.

    • @JoJoJet100
      @JoJoJet100 8 лет назад +41

      ***** I never said quaternions weren't impressive, but they're just so hard to use. Thank god for Quaternion.Euler

    • @siriusblack9999
      @siriusblack9999 8 лет назад +41

      +Jiří Bednář the thing is a quaternion's (X,Y,Z,W) values don't intuitively map to pitch/yaw/roll (with euler x = pitch, y = yaw, z = roll)
      so it makes quaternions harder to use in that way

    • @programagor
      @programagor 8 лет назад +2

      But they do intuitively map to the axis and angle of single rotation.

  • @eliotthung
    @eliotthung 3 года назад +216

    Even twelve years after its release, this video is still the best way to understand how works the Gimbal Lock. And with satisfying sounds on top of that !

  • @bgildersleeve
    @bgildersleeve 8 лет назад +242

    Best video on Gimbal Lock I've ever seen. Thank you for putting the time into making this!

    • @robosergTV
      @robosergTV 8 лет назад +4

      +

    • @AzgariusPWI
      @AzgariusPWI 8 лет назад +1

      +

    • @marcocoelho4258
      @marcocoelho4258 7 лет назад +1

      I have to agree, it's the best video on why "Gimbal Lock" is a problem. Knowing the problem makes it much more rewarding and relevant knowing the solution (in my case, Quaternions).

    • @ViggoTellefsenWivestad
      @ViggoTellefsenWivestad 7 лет назад

      I was gonna write the exact same comment, but instead, I'll just throw myself to yours :D

  • @katdrexed
    @katdrexed 4 года назад +33

    i have no idea what's going on, i just somehow ended up here
    ...and actually found this interesting

  • @SgerbwdGwyn
    @SgerbwdGwyn 8 лет назад +94

    6 years old and still the best damned explanation out there

    • @mechanicalorchards3961
      @mechanicalorchards3961 8 лет назад

      +ArraySix Holy crap array I watch your videos.

    • @blastpit39
      @blastpit39 8 лет назад

      +Mechanical Orchards this is old but its aray six

    • @mattgoodrich7571
      @mattgoodrich7571 6 лет назад +1

      I thought you were bragging about being 6 years old and understanding this video. Then I checked the video's date..

    • @lonttugamer2939
      @lonttugamer2939 6 лет назад +1

      @@mattgoodrich7571 me too lol

  • @TimJSwan
    @TimJSwan 10 лет назад +191

    Never use euler rotations. Use quaternions.

    • @ccvector
      @ccvector 8 лет назад +4

      +Giles Bathgate Have you found the video yet?

    • @TheSpacecraftX
      @TheSpacecraftX 7 лет назад +4

      Never use Haskell. It's evil.

    • @abdelrahman5094
      @abdelrahman5094 4 года назад

      why?

    • @GuillemPoy
      @GuillemPoy 4 года назад

      Now I only need to understand quaternions.

    • @darksidegirl
      @darksidegirl 4 года назад +2

      Unless you are an animator and have to work with CURVES.

  • @samuels1123
    @samuels1123 2 года назад +31

    One possible slightly cheaty solution is to simply break the motion into steps, calculate a very small change in angle and teleport the camera there, then repeat these very small steps until you are at a target angle, this is usually unnoticeable because computers tend to not bother with angular precision below thousandths of degrees so you can use that rounding as a 'blind spot' for in which to undo a gimbal lock.

  • @zouru
    @zouru 10 лет назад +173

    Those sounds are SO satisfying!

  • @ezydenias8505
    @ezydenias8505 6 лет назад +178

    Hilarious thing, In Blender Gimal Lock is often not a thing because many things are defaulted to Quaternion. That is why for years I never encountered gimbal lock. But than when I was working at a company on a cinema4d project I know that I totaly got run over by this. It was like the Programm was freaking out!. Because it rotated via euler by default so I was really dumbfounded and that was the first time I've heard about gimbal lock.
    This is a great video and tells me to avoid euler basically.

    • @monad_tcp
      @monad_tcp 5 лет назад +18

      I don't understand why don't they use quarternions and convert to Euler just for the UI manipulation.

    • @General12th
      @General12th 5 лет назад +7

      @@totoze1956 I wonder why the program doesn't use quaternions natively, then convert to Euler coordinates. Quaternions never run into gimbal lock. Transforming quaternions into Euler coordinates doesn't have the same problem as going in reverse.

    • @aliensoup2420
      @aliensoup2420 4 года назад +3

      Well in Blender, possibly Armatures are defaulted to Quaternion, but not common objects, such as cameras. The Blender camera is initialized pointing down. If you try to emulate the suggested rotation order illustrated in this video, (yxz in Blender) you run into gimbal lock as soon as the camera is oriented forward and level to the ground. You may have assumed you never experienced gimbal lock if you were rotating everything in Global mode, but trying to decipher rotation animation graphs like that is a nightmare.

    • @tropicarls
      @tropicarls 4 года назад +4

      I don't necessarily thin the video is suggesting you should avoid using euler angles, but that you have to find the correct angle pairing so that the rotation does not lock. Having said that, I do thin it would be easier, as funny as it sounds, to use the ugly quaternion

  • @alexholker1309
    @alexholker1309 5 лет назад +15

    Another benefit of the camera gimbal you suggest is that the gimbal lock occurs in the same place for your camera and a human cameraman. If you're holding a camera pointed straight up, it's a lot easier to lower it in the direction you're facing than in any other direction.

  • @DustyCowdog
    @DustyCowdog 8 лет назад +354

    I think I'm incredibly stupid.

    • @sachoslks
      @sachoslks 8 лет назад +7

      me 2

    • @Void-uj7jd
      @Void-uj7jd 6 лет назад

      Seems straight forward to me. But could be cause I programmed for 12 years...

    • @jan-zz4ww
      @jan-zz4ww 6 лет назад +70

      at least you watched that instead of the new taylor swift song recommended on the start page, so theres hope!

    • @tshichan
      @tshichan 6 лет назад

      ×) same here

    • @kb441ate
      @kb441ate 6 лет назад

      so am I

  • @orchs
    @orchs 10 лет назад +30

    This tutorial is incredible. You're an amazing educator and an amazing tutorialist.

  • @KuraIthys
    @KuraIthys 5 лет назад +10

    Good thing to know, since so many programs exclusively use euler angles.
    With real world gimbals, especially critical ones used in say, a navigation gyro, great care is taken to avoid gimbal lock for obvious reasons. However a solution that largely prevents it (I don't think it entirely eliminates it, but it does help a lot) is to use a gimbal with 4 axes.
    In computer programming of course, the best solution is to use a quaternion.
    However, understanding quaternions is pretty difficult.
    The concept behind what they do isn't so difficult, but understanding how and why they work is a bit less straightforward.
    In terms of rotation, a quaternion defines a rotation, and an arbitrary axis oriented in 3d space around which to perform the rotation.
    Of course, the reason why it's so confusing to understand quite how a quaternion accomplishes that task, is because strictly speaking a quaternion is a geometric operation that works in 4 dimensional space, NOT 3d space.
    (note meanwhile that euler rotation in 2d space cannot suffer from gimbal lock, thus you don't have to resort to stuff like quaternions or the like.)
    Actually, in purely geometric terms it's possible to interpret rotation as linear motion on a surface one dimension lower than the one you are working in.
    in 0 and 1 dimensions rotation is not a meaningful operation.
    In 2 dimensions you have one axis of rotation, and one of the peculiarities here is that this axis of rotation is perpendicular to the 2d surface itself. (in other words, the axis of rotation in 2d space points in a direction that would be physically impossible in 2d.)
    However, if you project a point onto a circle - (the distance doesn't matter,) then you can define rotation in terms of how far a point moves along the perimeter of that circle - and this is by definition 1 dimensional linear motion (albeit on geometry that isn't flat, and thus wraps around itself.)
    Similarly, in 3 dimensions you can determine 2 axes of rotation as being 2 coordinates on the surface of a sphere, which is, again, a 2 dimensional surface.
    of course, that leaves you with a third rotational axis that is undefined. However, the definition of a single axis of rotation is simply that of the 2d case.
    (technically I suppose 1 and 0 dimensional rotation also have to be accounted for, but those have no real meaning, so it's a moot point.)
    OK, so I probably won't win any prizes in mathematics with this explanation, but you might see how this can help explain a few things.
    It also provides a way to define operations that are equivalent to rotation, but happen in higher dimensions.
    In 4 dimensions it follows that there is a rotation defined as the position of a point inside the volume of a 3d sphere, plus the definitions for the 3d and 2d cases.
    Indeed in terms of euler angles, if you label 4d space as being XYZW, then rotations can happen along XY, XZ,YZ, XW, YW and ZW, but there should also be some rotation-like operation that operates along 3 axes at a time XYZ, XYW, YZW - whatever this operation might look like, it's going to be hard to visualise, since it's going to be an operation that doesn't make much sense in 3d space... (and visualising 4d geometry, much less 4d geometric operations is pretty difficult...)

    • @Tzizenorec
      @Tzizenorec 10 месяцев назад

      IIRC quaternions aren't a 4D rotation, though. They're a rotation _with a resize._
      Also, I don't think you're correct that 3D rotation can be specified with only 2 numbers? Every method of notating 3D rotation that I can find seems to require at least 3 numbers. (Including the not-commonly-used ones of "Axis angle notation but use the magnitude of the axis as the angle", and "Axis angle notation but specify the axis via longitude and latitude" [the latter of which you mentioned in your comment].)

  • @willmueller4984
    @willmueller4984 4 года назад +9

    The youtube algorithm is training it's future programmers

  • @axelpaccalin1833
    @axelpaccalin1833 6 лет назад +62

    The rotations used in 3D softwares are actually not stored in the Euler angles format but in the form of quaternions (or their matrix interpretations).
    This is why your rotation tool is not an Euler axes ruler, but one with 90° separated independent axes.
    These softwares will always allow you to use Euler angles because we, as humans, can't really intuitively use quaternions. It will however instantly convert them, thus preventing multiple problems (quicker to compute, only one representation opposed to the 6 Euler ones, and no gimbal lock).
    So, to recap, the camera problem is due to the interfacing you choose with the inputs (Euler in this case). There are other interfacing implementations available, directly using quat or matrices which can solve this.
    Awesome description of the principle of Euler angles and the concept of gimbal lock btw.

    • @skapaloka222
      @skapaloka222 10 месяцев назад +3

      i think that at the time that this video was made, software didnt convert to quaternions internally yet

  • @theshadowl4
    @theshadowl4 5 лет назад +23

    I didnt know Harambe was doing toturials in 2009 :O

  • @IznbranahlGoose
    @IznbranahlGoose 7 лет назад +47

    Not an animator but I've noticed something like this happening when building stuff on SecondLife. I even called it 'gimble lock' without realizing this was the actual term for it. SL programming also uses quaternians for the rotations but I find it's better to just think of them as 'black boxes of rotation' -- convert to Euler angles, adjust those, and convert back but don't look at or manually adjust the quaternian values inside. That way leads to madness.

  • @5eurosenelsuelo
    @5eurosenelsuelo Год назад +9

    I'd say 2:35 is a very nice hint about why quaternions are so useful to describe rotation. It's true you just need 3 parameters to describe rotations but having a fourth one makes things nicer.

  • @derboss66
    @derboss66 Год назад +19

    It’s crazy how a 14 years old video can still be so helpful to me

    • @007LvB
      @007LvB Год назад +1

      Try read a book xD

    • @drownedcreation
      @drownedcreation Год назад +1

      I promise you there's nothing crazy about that. As you grow up you will find information much, much older than this which can still be so helpful to you.

  • @LSSTmusic
    @LSSTmusic 7 лет назад +11

    Wow, I always wondered why some games have weird camera behavior at extreme angles, and it seems like this would have been the cause. Great video!

  • @keistzenon9593
    @keistzenon9593 9 лет назад +21

    check out the z-fighting on those axes (6:36). Great explanation it definitely helped me understand, but don't get fooled I spend quite some time on this, also used an interactive program to test it, made a paper gimbal, read on wikipedia and programmed a simulation from bare opengl. Also on many train rides I tried to simulate this problem in my brain: It can't be done, at least, I can't do. My brain doesn't have enough working memory for this.
    Things you want to keep in mind: there is a given hierarchy of axes, yes Euler angle can represent any orientatinon in euclidean space and finally, my personal last insight needed, gimbal lock is a problem of contiuous movement. If we try to orient an object, when it is already in a certain orientation, such as, best example, in gimbal lock, we can't perform straight forward transformation because we lack a degree of freedom. We need to backtrack the rotation where the degree of freedom is restored and approach the orientation we wanted all over again. This backtracking is what is bad for animatiors as between keyframes there will be discontiuous or deviant movement from the path of 'apparent least resistance'.
    I wonder if this helps anyone, I am just ordering my thoughts here.

    • @pabloariasal
      @pabloariasal 9 лет назад +2

      Thanks for your awesome explanation! It did help me. My rain can't simulate that neither.

    • @RealGames-v8b
      @RealGames-v8b 5 лет назад

      Yes! I agree to you opinion. I think that Euler angle can represent any orientatinon in euclidean space

  • @nvcworld6423
    @nvcworld6423 4 года назад +6

    Man you took a lot of efforts to make this complicated video in very easy way, you really mean it what happens , this is called mentality of scientist / Dr. , love to watch it

  • @StraveTube
    @StraveTube 3 года назад +7

    Man, I love that "Ohhhhh THAT'S how that works" feeling when you finally find a good explanation of a topic. Especially after watching several other videos that didn't manage to clear up my confusion.
    Thanks!

  • @power-max
    @power-max 5 лет назад +1

    So why then do we assert an order to X, Y, and Z? Why not define the axis of all rotations in the global coordinate system? So rotating along the X axis will always mean rotating along the X axis of the "universe"? This way the 3 axis of rotation are completely independent of each other and orthogonal.

    • @LabGecko
      @LabGecko 5 лет назад +1

      Look at the physical mock-up at 0:45. They are connected in order to maintain the relationship. If you unlock those, you lose the relationship of which is x, y, or z. They lose meaning. But if you code a graphics app or library that succeeds in using Euler angles without lock, share it to the world and tell a friend to nominate you for a Nobel. I'm not being sarcastic - it really would be awesome.

  • @flashcode0
    @flashcode0 10 лет назад +26

    Fantastic video! I found it very helpful.

  • @coffee_candy_
    @coffee_candy_ 4 года назад +7

    I open the video:
    *monkee*

  • @CybeargPlays
    @CybeargPlays 8 лет назад +8

    I'm trying to learn Quaternions and keep hearing Gimbal Lock mentioned, but this is the first time anyone ever bothered to explain it. Luckily, it was a very good explanation!

  • @keithlegg
    @keithlegg 8 лет назад +8

    how can anyone dislike this video? Seriously, this is great.

  • @FlyingHighUp
    @FlyingHighUp 11 лет назад +8

    Out of all the tutorials I've watched/read that attempted to explain gimbal lock to me, this one was the one that did it. Awesome video!

  • @ronanderson1023
    @ronanderson1023 9 лет назад +10

    These explanations are amazing with these visualizations! Your work is very, very much appreciated. You should make some videos about more complex topics. One could benefit a heck of lot with your way of teaching!
    Greetings and all the best to you!

  • @stealcase
    @stealcase 2 года назад +6

    I found this video years ago, and and it's honestly one of the best introductory videos on this.

  • @LucasStraub
    @LucasStraub 9 лет назад +13

    Man... This is the best explanation I find so far. Thanks very much!

    • @ORIGAMIDAN1
      @ORIGAMIDAN1 7 лет назад

      стихи блока слушать фффф

  • @TheNoobzoid
    @TheNoobzoid 11 лет назад +1

    you can some what beat the gimbal lock if you have another controller underneath the hierarchy, but when they both lock up after you use it, yur shit outta luck.

  • @matchesburn
    @matchesburn 4 года назад +1

    Well, there's already a solution to gimbal lock that the aerospace industry came up with: have a fourth ring/axis. Actually, the guidance control system on Apollo 11 had a gimbal lock issue during landing on the moon because NASA decided to use a more traditional and simpler and known reliable 3-axis gimbal in the space craft. Michael Collins even joked about NASA giving him a "4th gimbal for Christmas" because it was an issue for him in the command module. Didn't happen, however, and it was also an issue in Apollo 13 where the space craft was tumbling around uncontrollably immediately after the explosion.

  • @paradiselost9946
    @paradiselost9946 10 месяцев назад +1

    see this in so many every day objects where things werent thought through...
    thinking of things like DIY trikes where people stick two wheels in instead of forks... failing to realise that the tilted headtube will cause you to lean the wrong way in a turn...
    much like skateboard trucks... always fun to prank people with reversed truck(s)!
    my recent experience was making a blade/trailer/grader for the tractor... you want to pivot the blade in three axes, and they conflict, so adjusting is always fiddly. you dont get lock but heirachy of pivots matters when designing to reduce interactions.
    and that also was a lesson in harmonics. its sort of important where the blade is in relation to the axle of the trailer and tractor... it cant be halfway! you get harmonics... "sidebands"

  • @foldupgames
    @foldupgames 4 года назад +2

    I come from the futuuuurrrreeee. That is still an amazing and informative video.

  • @AFatWhiteShark
    @AFatWhiteShark Год назад +1

    What would you like for Christmas?
    ... Well, a forth gimble would be Nice...

  • @debrachambers1304
    @debrachambers1304 Год назад +1

    Why not just use axes that can't change each other? Ex: angles from spherical polar coordinates + bank.

  • @pbierre
    @pbierre 9 лет назад +4

    The information about a 3D rotation is "overcompressed" in Euler angles, leading away from a 1:1 numerical representation. A simpler approach is to use a 3x3 matrix "rotator" (information spread across 9 numbers instead of 3). If you know how 3D direction vectors (unit vectors) are used to represent directions in 3-space, then the matrix represents the pointing directions of the 3 local-object axes x-y-z in the reference axes system X-Y-Z. The elegance of rotators for computing is they offer a 1:1 numerical representation -- every unique axes rotation has a unique numerical representation, and visa versa (if we accept that -0 and +0 are the same).

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 7 лет назад +3

      The problem with using a general matrix just to deal with rotations is that they can accumulate rounding errors. Say you do a whole succession of small rotations (like in an animation): the resulting accumulated matrix will likely no longer represent a pure rotation, it will add some distortion to the object as well.
      You can fix this by periodically renormalizing the matrix. Or you can use a representation that only represents rotations (like quaternions), and avoid the problem altogether.

    • @pbierre
      @pbierre 2 месяца назад

      @@lawrencedoliveiro9104 Yes, you wouldn't want to use a 3x3 matrix as a rotational accumulator or interpolator. But for one-off computations, they 3x3s are much more intuitive, and thus easier to teach and learn. So, the choice depends upon the application.

  • @AHSEN.
    @AHSEN. 3 года назад +2

    One solution though for gimbal lock is to set the correct location for objects frame by frame, or an extra keyframe on either side of each locked position

  • @spookyturbo1618
    @spookyturbo1618 6 лет назад +3

    So happy I found this explanation. All the other ones I found left out how the parenting system works between gimbals and thats what I was confused on. Thanks!

  • @qp12qp
    @qp12qp 14 лет назад +1

    If it can be improved to perfection 100%, then we should only bother with that version. If the only perfect solution is quaternions then we should only use quaternions. This is 21st century -we are almost ready to visit Mars, don't tell me I can't point the camera down or up! This is ridiculous! I bet that a more intuitive method than quaternions but also perfect for rotations can be invented. We shouldn't just stuck on things invented 250 years ago! Where is our contribution?

  • @qp12qp
    @qp12qp 14 лет назад +1

    @andrewsilke1 (...late answer)
    I've used it, and experienced it's ...beauty of gimbal locks and limitations, especially on Blender with all sorts of problems related to rotations.
    I don't care about statistics and how many use it. Statistics are most of the time misleading and what the majority does is most of the time wrong. I only care about a system that works perfectly for its purpose as expected. This system IS fundamentally faulty or inappropriate for 3D rotations.

  • @qp12qp
    @qp12qp 15 лет назад +1

    Thax a lot but:
    This video should serve just as an explanation of the Euler method's flaw and why we should NEVER use it to rotate anything, instead of providing a partial solution which still gives us a faulty rotating method.
    (For example, what if the camera looks straight up or down and then try to rotate to the other axis that causes gimbal lock?)

  • @ninjei
    @ninjei 15 лет назад +1

    If I understand correctly - Y was put as the main parent - because it is will likely be the most used axis, then X - because it will be the least used axis - then Z..
    1 - most used axis
    2 - then least used
    3 - the axis between the extreems...
    reason being - gimble lock occurs when the second axis hits a certain point... uhhh makes sense.... i think.

  • @lushen952
    @lushen952 3 года назад +1

    With the camera example why not just block out the twist rotation because I can't think of a single example where the camera rotates it's orientation.

  • @Jimmysage3273
    @Jimmysage3273 5 месяцев назад +1

    Like if you have Apollo questions and didn’t even realize this applied to animation

  • @farshidhss
    @farshidhss 10 лет назад +5

    Didn't they use Quaternion to avoid all this?

    • @dimumurray
      @dimumurray 10 лет назад +1

      Yup. Sadly a lot of 3D software still use the Euler system so folks who use those tools have to be aware of this stuff. Quaternions are amazing though, but conceptually they are not the easiest things to grasp.

  • @seamusmcboon558
    @seamusmcboon558 4 года назад +3

    I've literally been searching for a clear explanation of this since the first time I saw Apollo 13 in 1995 and this is the first time I've really understood it, thank you!

  • @NonoGG
    @NonoGG 8 лет назад +6

    Quaternions ftw :D

  • @felixxia3604
    @felixxia3604 11 месяцев назад +2

    14 years after this video was posted, i learn why we need to study and use quarternion in houdini. awesome video.

  • @St0RM33
    @St0RM33 2 года назад +1

    that's a half-assed solution though..not a true solution

  • @PhilbyFavourites
    @PhilbyFavourites 4 года назад +2

    RUclips recommendations: like a flash from a visiting alien.... you’re intrigued but you have absolutely no idea why!

  • @GRBtutorials
    @GRBtutorials 4 года назад +1

    Or, just use quaternions. Problem solved!

  • @LudwigvanBeethoven2
    @LudwigvanBeethoven2 5 лет назад +3

    Finally I understand the magical W component of quaternion

    • @ZoranRavic
      @ZoranRavic 4 года назад

      The xyz components in quaternions aren't the same as xyz component in euler angles

  • @manodahu
    @manodahu 15 лет назад +1

    OK, but can you tell me what is the relation between Euler angles and Cardan angles?

  • @TheJadeFist
    @TheJadeFist 9 лет назад +6

    Now why some games' camera freaks out when trying to go straight up or down makes sense

    • @AnaseSkyrider
      @AnaseSkyrider 8 лет назад +4

      Ooooooooooohhhh... I've always wondered why some games won't let me look straight up or down...

    • @purpleice2343
      @purpleice2343 8 лет назад +1

      Actually it's more of a personal preference, once you use Quaternions (YOU SHOULD), anyway it's impossible to look straight down, probably devs just were obsessed with realism.

    • @mi8628
      @mi8628 4 года назад

      @@purpleice2343 I can look straight down just fine, I don't think realism would be a reason for that.

    • @purpleice2343
      @purpleice2343 4 года назад

      @@mi8628 It's literally impossible to rotate your head like that, if you did, you'd be dead.

    • @mi8628
      @mi8628 4 года назад

      @@purpleice2343 Looking straight up is not possible, but looking straight down is easy.

  • @weebgrinder-AIArtistPro
    @weebgrinder-AIArtistPro 3 года назад +1

    Here to learn about gimbal lock as it applies to spacecraft and surprisingly this helps a lot.

  • @andrewmasek2170
    @andrewmasek2170 6 лет назад +2

    Why don't programs switch the rotation order under the hood when they detect that there will be gimbal lock the following frame?

  • @user42344
    @user42344 2 года назад +1

    If I were a gimbal I would simply never lock

  • @poe84it
    @poe84it 6 лет назад +10

    luckily we have sir Hamilton that saved the day with quaternions!

  • @shukfahid
    @shukfahid 14 лет назад +1

    quadrerion rotaion as in flight simulator? hope i spelled all that right.

  • @christopher8116
    @christopher8116 10 лет назад +4

    Change the order of rotation and you solve Gimbal lock. Nice tutorial very nice, we need more tutorials that go into the difficult questions of computer generated imagery because Guerrilla project does a good job at explaining.

    • @renderuthis
      @renderuthis 10 лет назад +2

      When can you change the rotation order? Never that I know of.

    • @blog500070
      @blog500070 10 лет назад

      renderuthis before you set any keys or animation

  • @Thaumazo
    @Thaumazo 8 лет назад +30

    GImbal Lock was also a headache for Apollo 13 astronauts ;)

    • @Hypercube9
      @Hypercube9 6 лет назад +4

      They fixed that for future missions by simply adding a fourth gimbol.

    • @drtidrow
      @drtidrow 6 лет назад +3

      Hypercube9 I don't think they did that, or at least I haven't been able to find a reference... can you post a link to one?

    • @melficexd
      @melficexd 5 лет назад +1

      NASA then standardized the flying rotations and maths for the space shuttle program 😄
      ntrs.nasa.gov/search.jsp?R=19770019231

  • @DavidMcCullough2
    @DavidMcCullough2 7 лет назад +2

    Fantastic explanation of gimbal lock. I have been trying to find a good one for a while. Now, if you don't already have one, please make a very similar video explaining quaternion rotations! :D

  • @joshuarivet4752
    @joshuarivet4752 4 года назад +1

    Why am I being recommended this.

  • @rohithzhere
    @rohithzhere 15 лет назад +1

    I need to copliment this guy for the effort he has made to explain the "GIMBAL LOCK"...AN AWESOME VIDEO....Grt Work Mr Andrew Silke....
    That presentation was simply 2 good...

  • @shukfahid
    @shukfahid 14 лет назад +1

    i also use constraints to limit the possibility of gimbal!

  • @avion85
    @avion85 15 лет назад +1

    its also the most intuitive, and has a couple of solutions

  • @ChrisMcKeown560
    @ChrisMcKeown560 11 лет назад +1

    He pronounces it correctly. Google it.

  • @marclomberg6327
    @marclomberg6327 9 лет назад +1

    maya rokkkkz earth is flat

  • @MounirCinema
    @MounirCinema 4 года назад +1

    best explanation ever .. thank you

  • @argonwheatbelly637
    @argonwheatbelly637 5 лет назад +1

    I've seen robotic arms do horrible things due to gimbal lock. Thank God that He gave Hamilton the idea for those wonderful Quarternions!!! He even wrote them on a bridge!!!

  • @LimitedWard
    @LimitedWard 10 лет назад +5

    Couldn't the program just be smart enough to recognize when an object is in gimbal lock and change the order of rotation to solve the problem?

    • @andrewsilke1
      @andrewsilke1 10 лет назад +2

      ***** you can use quaternion math but it uses vectors which you can't graph for animators

    • @andrewsilke1
      @andrewsilke1 10 лет назад +5

      LimitedWard, sorry it doesn't work that way, if you auto corrected order of rotation the the curves in the graph editor would be a mess unfortunately.

    • @LimitedWard
      @LimitedWard 10 лет назад +1

      andrew silke Why? What would happen? Would there be some sort of error propagation?

    • @AvihooI
      @AvihooI 10 лет назад +3

      You can use quaternions in conjunction with some form of rotational linear interpolation between them for animations but I guess it really depends on the underlying software. Besides, this has other drawbacks.

    • @andrewsilke1
      @andrewsilke1 10 лет назад

      Yeah it all gets pretty messy with other techniques, sometimes I'll plot keys and use a euler animation switcher so you can switch between gimbal space, it's just easier in complicated situations. Luckily though they don't come up too much. You can get those scripts for Maya that modify curves when you switch gimbal modes.

  • @SlashXel
    @SlashXel 15 лет назад +1

    for a first time i m seeing this kind of problem

  • @44hawk28
    @44hawk28 4 года назад +1

    I only run into this issue once on an F-111 where I was an avionics Tech specialist. We had an aircraft that be attitude Direction indicator would not point in the direction the aircraft was headed and any time you tried to slave it and correct its positioning it would end up going 90 degrees down and start rotating slowly counterclockwise. Establishing gimbal lock basically headed to the Earth. After several tries and even disconnecting and reconnecting the directional gyro. I shut it down what back took the gyro, it was still spinning down oh, and it tried its level best to jump out of my hands. I had taken out spinning gyros in the past and as long as you handle them carefully you don't usually run into a problem. But this one was really unstable. I set it on the ground let it spend down for a few minutes so that I could put it in the truck. I wrote it up as being off its gimbals. I described the malfunction and sent it into Depot maintenance for service. I did not keep track of it to see what aircraft it went into to see if that aircraft eventually had a repeat occurrence. The only other 2 unusual situations I had with directional Gyros was I have worked on one that was actually built by singer and it was the best operating and most stable directional gyro I had ever worked with. It was noticeably a better unit then the other two or three manufacturers we had on the base. The other time is I had to change one while the aircraft was running because the pilot needed to fly a mission and I got into it he described what the problem he had from the cockpit, I got into it swapped out the directional gyro and he cranked it back up and it seems to run fine with a quick check and I reminded him to make sure he was aware of his redundant systems. And he took off. Never heard another issue about that particular aircraft. At least not about the navigation system.
    So am I understanding that gimbal lock occurs when the angular momentum is functionally equal between the two gimbals? It sounds like the differential speeds of the individual rotations is key to avoiding gimbal lock.

  • @Ryuji815
    @Ryuji815 5 лет назад +2

    I wasn’t aware that there was some kind of restriction in modeling until I have seen this video. I haven’t had this problem yet, but the video itself shows me that modeling can only rotate in so many directions before it gets locked. I can imagine that it may cause issues with animators who are assigned to animate the models to make them do certain things. With this new information, I will have to be careful where I turn certain parts in my models so I can at least be assured that it can be avoided altogether.

  • @hjp4109
    @hjp4109 9 лет назад +2

    But Quaternion was not support Curve Edits , Therefore, how can i do this?
    how can i avoid gymbol lock in animation?

    • @purpleice2343
      @purpleice2343 8 лет назад

      Do it just like in the end of the video and try to never look straight up or down.

  • @pushpendre
    @pushpendre 15 лет назад +1

    Looked all over the internet including youtube before hitting this video. finally understand gimbal lock's problem. THANKS A LOT

  • @SP4CEBAR
    @SP4CEBAR Год назад

    Oh I get why Unity's Euler converted to quaternions works, gimbal lock isn't as much of a problem when objects don't move, so for defining rotations in Euler works, but animating between them is done by quaternions

  • @bamgb8811
    @bamgb8811 Год назад +1

    2:35 why wouldn’t you just move the red circle to where the grey one is by moving it with the green circle ? You can keep the arrow in the same position by moving the blue circle in the opposite direction as the green

    • @bamgb8811
      @bamgb8811 Год назад

      @@leeroyjenkins0 I think I didn’t explain what I meant well. What I meant is this: imagine moving the redline 90 degrees to be inline with the grey line (instantly) after this the blue line would’ve changed so the arrow wouldn’t be in the same position so using the blue line you’d have to roll it back 90 (instantly again) so that the arrow is in the same position that it was in at the start only now the redline (because it is effected by the green line but not the blue) is rotated 90 so it lines up with the grey , this means that the desired animation of rotation can occur exactly as illustrated in the video. However it requires doing two rotations first in zero time , not using a fourth axis or using quaternions.

    • @bamgb8811
      @bamgb8811 Год назад +1

      @@leeroyjenkins0 ahh I get what you mean, and I’ll assume you’re correct because there’s no reason not to. I understand quaternions would be better in some instances depending on the preference of the people using them, yes. But I think a lot of explanations imply that gimbal lock destroys everything and we have to go into the fourth dimension to fix it, instead of just saying that quaternions are pretty neat to visualise (ignoring over focus on the 4d aspect) and efficient in some circumstances. I think your right in saying that there’s a lack of good coverage of the topic which is probably leading many people into confusions

  • @pigeon4422
    @pigeon4422 Год назад +1

    but man quaternions are hard

  • @rajmohann
    @rajmohann 3 года назад +1

    Perfectly made video that explains about Gimbal Lock and Rotation Order while using Euler rotation. Thank you!

  • @InbasagarNadar
    @InbasagarNadar Год назад

    Everyone is realizing why something didn't work 5 - 10 years ago after watching this video XD
    I am here at 4AM between my indie game dev session because I randomly felt like understanding the difference between Quaternion and Euler and while researching I found out about the gimbal lock problem

  • @hi_its_jerry
    @hi_its_jerry Год назад +1

    im self taught, and i really wish i'd seen this sooner. wouldve prevented so many headaches

  • @santhoshmamidisetti
    @santhoshmamidisetti Год назад +1

    me watching it in 2023 !

  • @kakyoindonut3213
    @kakyoindonut3213 Месяц назад +1

    came here for the gorilla

  • @fusseldieb
    @fusseldieb 7 лет назад +1

    These animations combined with those sounds reminds me of old VHS 1990 tutorials.

  • @yimoawanardo
    @yimoawanardo 5 лет назад +1

    No thanks. I think I prefer learning quaternions.

  • @martinskopek3730
    @martinskopek3730 4 года назад +2

    WHY is this in my recommended and why now?

  • @michaeljorgensen790
    @michaeljorgensen790 10 месяцев назад

    This (rotation order) seems like a low tech way of preventing gimbal lock and only decreases the likelihood.
    It seems like there are ways of totally eliminating gimbal lock with rotation encoders and wireless accelerometers attached to each gimbal axis that would detect and compensate whenever 2 axis aligned. In the 1960's it would be difficult....but this is 2023.
    By the way....shouldn't we all be driving flying cars?

  • @Calling321
    @Calling321 8 лет назад +1

    I had this problem in blender. I had found the axis I wanted to rotate on was Y, so I just locked the Z and X axis. This solved the problem in my case.

  • @RogerBarraud
    @RogerBarraud 4 года назад

    So why aren't planes equipped with a Real Axis control as well as elevators, ailerons and rudders?
    How many people has this huge oversight killed so far???!!!!11!?????!!
    :-/

  • @rodolphecargou4396
    @rodolphecargou4396 7 лет назад +11

    Am I wrong to think that gimbal lock is just a result of a higher problem, wich is the desynchronisation between the world axis and model axis ? A good way to represent a object rotation shall include that each time a rotation is made on a particular axis, the two others axis shall be rotated two, and that if we want to perform a rotation on another axis later, then it shall be around the object axis, and not on the world axis.
    Still wondering if I got something or if i'm saying pure shit, but pls: help !

    • @jayxtreme6
      @jayxtreme6 5 лет назад +14

      it's actually not quite that simple. The real problem (in the most intuitive way I can explain, without omitting any important nuances) is that euler angles don't actually describe the surface of a sphere (imagine a unit vector being rotated through all possible rotations, and the tip of the vector drawing out the sphere). The problem is that if we don't force the length of the vector to be 1, our euler angles don't actually describe a sphere, they describe a 3-torus (the surface of a 4 dimensional torus). To squeeze the 3-torus down into a sphere (so we can use euler angles to give us meaningful rotation information) by forcing the length of the vector to be constant, we create singularities where we lose a degree of freedom (this is gimbal lock). The short of it is: we can't make euler angles not have this problem. If we shifted the other gimbals around just for the sake of avoiding gimbal lock, individual euler angle rotations would have no meaning, so we would be better off using a system that makes sense (at least mathematically), and that's what quaternions do.
      A simpler version of this problem happens with GPS coordinates. You've got longitude and latitude. If you crank up latitude to 90 degrees (or -90), no matter how much you change the longitude you're still at the north(or south) pole. This is an equivalent problem to gimbal lock, and it happens for the exact same reason (and has the benefit of being easy to visualize). If you don't restrict the length of the vector, this longitude / latitude system describes an infinitely long cylinder. The squeezing of this cylinder down into a sphere gives us the same problem as gimbal lock has with euler angles.

    • @slehar
      @slehar 5 лет назад +3

      You are right, actually. And that is exactly how quaternions work. Instead of using global coordinates, the x,y,z axes are anchored to the object in question, so when the object rotates, the coordinate system rotates with it. Instructions for a pilot to pull-up, yaw-left, roll-right, are meaningful to the pilot in the rotating plane whatever its orientation might be.

    • @lyrimetacurl0
      @lyrimetacurl0 5 лет назад

      If the latitude goes over 90 degrees that's just the same as under 90 degrees. Or in spherical coordinates that would be over 180 degrees which smoothly transitions to the same place as under 180 degrees, just there are two numbers meaning the same thing.
      Maybe spherical coordinates would have a problem with some motion though because of the increased speed of changing longitude if passing near the nadir or zenith.

  • @takshashila2995
    @takshashila2995 5 лет назад +1

    why is this in my recommended?

    • @abdu1998a
      @abdu1998a 5 лет назад

      wasn't it worth it though?

  • @epasko5713
    @epasko5713 7 лет назад +1

    Great! Wished I had seen this Before I crushed my pinky
    playing with an old Aircraft Gyro I found, Sold it on Ebay
    next day...Thank's!!! Good job!!! AAA+++