Skeletal Animation - From Theory and Math to Code

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ม.ค. 2025

ความคิดเห็น • 42

  • @FloatyMonkey
    @FloatyMonkey  4 ปีที่แล้ว +12

    Wow, thanks for the more than 340 subscribers everyone, this really means a lot to me!
    I wanted to publish this video earlier but I was working on something really exciting, watch until the end to figure out what ;)
    I'm taking my time to add timestamps to all my educational videos now that TH-cam conveniently shows them in the video timeline.

  • @richardcesar5546
    @richardcesar5546 7 หลายเดือนก่อน +3

    This... This is gold. 4 years old and it is still the best I have found.

  • @blarghblargh
    @blarghblargh 3 ปีที่แล้ว +10

    Love that you included the suggestion to use a flattened hierarchical memory layout. Very important perf step that people might skip to make the tree concept more simple, or try to make the "bones" some OO thing.

  • @bartlx
    @bartlx 3 ปีที่แล้ว +3

    Like 309 came from me ;) Well deserved! Exactly the clear and, all considered short, explanation I was looking for at around 5h AM. Thank you!

  • @bluesillybeard
    @bluesillybeard 7 หลายเดือนก่อน

    Holy Moly Guacamole! This is the best resource on skeletal animation that could ever possibly exist. I went from barely knowing anything about skeletal animation to being able to implement it in my own engine!

  • @thejolv
    @thejolv 4 ปีที่แล้ว +2

    Thank you so much for this video !
    You have a very clear way to explain concepts, the visuals are very nice and your voice tone is perfect to keep our mind focus :)
    Please keep it up !

  • @Lampfaho
    @Lampfaho 3 ปีที่แล้ว +2

    Very well done sir. By far the best tutorial on this subject. Thank you

  • @alexkfridges
    @alexkfridges 3 ปีที่แล้ว +1

    Insanely good video. Keep making these!

  • @leodaza2151
    @leodaza2151 2 ปีที่แล้ว +1

    Thank you so much for this video, it helped me solve the matrix multiplication issue for the bones in the graphics engine I'm building

  • @MintTree117
    @MintTree117 11 หลายเดือนก่อน

    Thank you, wonderful explaination!

  • @santi5655
    @santi5655 2 ปีที่แล้ว

    finally got this working, your video was super helpful thanks

  • @berthold64
    @berthold64 4 ปีที่แล้ว +1

    WOW.
    THANKS! I'm desperately searching for new animation tutorial

  • @ricopin
    @ricopin 2 ปีที่แล้ว

    Thank you that was exactly the video I needed!

  • @joshuamora411
    @joshuamora411 3 ปีที่แล้ว

    I have 0 idea with coding, looked up how to make Skeletal system for a game. Saw complex ass thumbnail and then: From Theory and Math to Code.. I feel home

  • @crispyowl7178
    @crispyowl7178 4 ปีที่แล้ว

    This is phenomenal!

  • @FuelledByCaffeine
    @FuelledByCaffeine 4 ปีที่แล้ว

    Interesting video, thanks for taking the time to explain it all :)

    • @FloatyMonkey
      @FloatyMonkey  4 ปีที่แล้ว +1

      Thanks, and no problem, I love explaining these things.

  • @joshuamora411
    @joshuamora411 3 ปีที่แล้ว +3

    18:22 "With all this knowledge you are now ready to implement skeletal animation into your own game engine" (After I understood 2% of the Implementation block) I need to learn more of them basics (any tips)

  • @xr.spedtech
    @xr.spedtech 2 ปีที่แล้ว

    Is there a code specification for blender skeleton specs ?
    I wanted to write code that can directly absorb a .blend/.blend1 file
    To access the skeleton metadata...

  • @undefBehav
    @undefBehav 6 หลายเดือนก่อน

    Great explanation. One thing I don't understand, however, is why do you have to export/import/calculate rest pose bones and `inMatrices` separately, and in local (relative) space at that? Doesn't Blender already provide bone transforms in model (absolute) space per frame that you can directly use to transform vertices? That way, a single matrix multiplication per vertex would do the trick to correctly transform the model, without having to rely on parents appearing before their children in the bones list, or those model-to-local and local-to-model transforms, or anything else.

    • @FloatyMonkey
      @FloatyMonkey  6 หลายเดือนก่อน

      Excellent question. That would be possible if you were to play back the animation at the exact same framerate and without any further alterations. When storing the matrices in global space, it is however no longer possible to smoothly blend between animations since this requires local space for the rotations to be correct. In the context of games, blending is used for all sorts of things: to alter the animation playback rate, transition between different animations, perform procedural adjustments, etc. all which benefit from local space. Another reason is that local space often has less fluctuation in its range of values or keeps certain keyframes constant e.g. translation, aiding in compressing the animation data. Hope that answers your question.

    • @undefBehav
      @undefBehav 6 หลายเดือนก่อน

      ​@@FloatyMonkey Thanks, that definitely helped clarify things! So basically what you're saying is storing transforms in local space makes sense, because we need them to correctly interpolate between keyframes or different animations. I think I was confused because somewhere along the line I remember you saying you wouldn't go into interpolation for the time being. Anyway, it all makes sense now, thank you!

  • @CL-pg6iu
    @CL-pg6iu ปีที่แล้ว

    How can i export the "InMatrices" from blender?

  • @Retpmus
    @Retpmus 4 ปีที่แล้ว

    Any chance of you sharing your Blender exporter for skeletal animation?

  • @noahblaine1901
    @noahblaine1901 2 ปีที่แล้ว +1

    I think by leaving out the setup in code of the buffer objects makes this video very incomplete

  • @aboutvenice
    @aboutvenice ปีที่แล้ว

    Hi, thanks for the great tutorial. When you mentioned the matrix of animation, we need to use Final = AnimM hand * InvM hand. Does this mean we must change our bind pose back to the original pose(the one we haven't bound yet) and then apply the animation? Thank you.

    • @lanchanoinguyen2914
      @lanchanoinguyen2914 10 หลายเดือนก่อน

      you can use formula: (Vertice-bone)*matrix+bone
      Or just use the inverse bind matrices.Inverse bind matrix contain the bones themselves so you only need to multiply with them to get back the the origin,the inverse matrix will form an identity matrix when combine with its original matrix that eliminates the unwanted rotations and only translations.But i'm not an expert about this,i use the inversion of bone vectors instead for my system.

  • @willfdz
    @willfdz 4 ปีที่แล้ว

    really thank you, i like graphic programing / blender to be honest im not a genius or a decent programer, i was struggling with armature / bones assimp implementation, i research a lot in google but cant get it, but after watching your video i think im start to understading i subscribe

  • @xAwesomeLetsPlaysx
    @xAwesomeLetsPlaysx 4 ปีที่แล้ว

    Thank you.

  • @dr.ozitron2095
    @dr.ozitron2095 3 ปีที่แล้ว +5

    2:35 his root is quite large :)

  • @voodoomotion5855
    @voodoomotion5855 3 ปีที่แล้ว

    Great tutorial, exciting to see 3d content entering your own engine. Is it easy to program the bone angles rather than have it all pre-animated?

    • @FloatyMonkey
      @FloatyMonkey  3 ปีที่แล้ว +1

      Thank you. Everything is pre animated and then exported from Blender to my engine using a custom Python script. As to why we have to go through all the math to transform from bone to model space, this is just so we can blend between or transition from/to multiple animations. If everything was in world space to start with, the system wouldn't be as flexible and the results might even suffer. Hope that answers your question ;)

    • @voodoomotion5855
      @voodoomotion5855 3 ปีที่แล้ว

      Thanks for such a quick reply. Yes I know what you mean, it's amazing how well animation blending works. I often animate 3d characters and blending is a god send. What I meant was if you had a bone hierarchy and wanted to directly control the bone rotations with a slider value, is that possible? I think it involves converting quaternion rotations into a matrix and multiplying by it. Was hoping that would be easy to do with your engine? Most openGL tutorials only seem to import the animation. Appreciate any advice you can offer. Thanks again 😊

    • @FloatyMonkey
      @FloatyMonkey  3 ปีที่แล้ว +1

      I import the full bone hierarchy so editing rotations with a slider would be possible although it's currently not exposed in the UI. I actually don't use matrices but have a special 'Transform' class, which stores translation, rotation and scale separately. This uses less memory than matrices. Just like matrices you can multiply Transforms although the latter is faster on the cpu. Rotations are represented as quaternions and not as euler angles by the way. So a slider would have to convert from euler angles (more artist friendly) to quaternions (more math friendly). Before uploading to a shader, I convert my Transforms to 4x3 matrices, since gpu's handle these faster. As I said in the video, I will make more videos (about animation) in the future, stay tuned.

    • @voodoomotion5855
      @voodoomotion5855 3 ปีที่แล้ว

      Thanks for replying, yes that makes perfect sense. Rotations seem simple until you realise the problems and start learning about quarternions! 😂 I built a small simple 3d engine from scratch a while ago but struggled with the parent and local rotations. The math wasn't very efficient, so I hoped to switch over to OpenGL. Another learning curve 😂 I work in animation and have created a few 2d tools that help my workflow but now need 3d calculations. Be great if you can create a tutorial on manipulating a hierarchy with OpenGL. Thanks again, keep up the great work!

  • @moises32123
    @moises32123 3 ปีที่แล้ว

    Hey FloatyMonkey, really nice work there. I was wondering if there's any written bibliography you used to create this content, I'm doing a written job and I wanna add some books for this part, thanks in advance !

    • @FloatyMonkey
      @FloatyMonkey  3 ปีที่แล้ว +1

      Thanks. Unfortunately I didn't really use any books. It's mostly made from experience.

  • @juliandurchholz
    @juliandurchholz 4 ปีที่แล้ว +1

    Good video! May I add that what you're referring to as "cache coherency" is actually called spatial locality.
    Cache coherency describes the consistency of memory across different caches.

    • @FloatyMonkey
      @FloatyMonkey  4 ปีที่แล้ว +1

      Thanks! Guess I've learned something today, thanks for letting me know.

  • @robertjr.kibble8053
    @robertjr.kibble8053 2 ปีที่แล้ว

    .... I'm sorry but how do you spell _____ concurrency? I need to know. Also your videso are AWESOME

  • @pacifiky
    @pacifiky 6 หลายเดือนก่อน

    100th like lol but awesome video!

  • @xr.spedtech
    @xr.spedtech 2 ปีที่แล้ว +2

    Well ...
    We have a lot in common you and I...
    Like the fact that we both look like tall toothpick-like males ...