Computing the Inertia Tensor of a Triangle Mesh in C/C++ | Devlog Episode 6

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ธ.ค. 2024

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

  • @cmedia425
    @cmedia425 8 หลายเดือนก่อน +8

    the editing, the comedic timing, the math, everything is top notch. wow thank you

    • @blackedoutk
      @blackedoutk  8 หลายเดือนก่อน +1

      :D 🙏🙏

  • @jamesking2439
    @jamesking2439 ปีที่แล้ว +24

    It's amazing how accessible you make such a difficult topic. I've been looking for something like this for years.

    • @blackedoutk
      @blackedoutk  ปีที่แล้ว +7

      That's great to hear, thanks. I've been looking for it too 😅

  • @marcoghislanzoni
    @marcoghislanzoni ปีที่แล้ว +22

    This series is pure gold for anyone interested in physics simulation. Really enjoyed every minute and every equations in it. 🙂 Keep it flowing! 👍

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

      Thank you, I'm really happy to hear that, it means a lot. I hope I can continue soon, when I'm less busy with other stuff

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

      @@blackedoutkI can tell there is a huge amount of work behind each one of your videos, so I can image you cannot focus on them 100% while you have other priorities. I have subscribed anyway, so when the next one comes I will know for sure ;-)

  • @desine_
    @desine_ ปีที่แล้ว +8

    some time in the future I'll get there..
    thanks for the great content

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

      your progress is pretty good so far

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

    Great video, very useful as I currently have only box and cylinder inertia tensors predefined so this will be very helpful in the near future, thank you! 👍

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

      Thanks! Boxes and cylinders are a good starting point, but I think matching them to the shape of a mesh can get a bit annoying

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

      Yeah, I know, this one has been in my ToDo list for a while.
      This definitely saves you a lot of time, but sometimes you want to play around with the IT to give a unique behavior to certain objects, for example, some racing games place the center of mass below the object physical hull so that when it turns upside down it flips back on its wheels by itself, and with the IT you can create an inertia tensor to have the bulk of the mass unevenly distributed along an axis to prevent it from rotating in a certain direction, IMO the physics engine goal is to fit the gameplay requirements and not simply to be realistic but that's a debate for your discord 🙂

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

      @@ramoncf7 Ah I've seen that people want to manually move the center of mass in the bullet forum haha. Actually I agree with what you're saying. I would just prioritize a realistic setting as a default and also let the user choose realistic methods of changing the inertia tensor instead of only having the option to arbitrarily move the center of mass. For example to make the bottom part of a car heavier one could add a heavy box to the model just for the computation.

  • @erpaninozzo
    @erpaninozzo 6 หลายเดือนก่อน +10

    I really like your videos :D, are you going to make another soon? It would be cool a video about the implementation of collisions.

    • @blackedoutk
      @blackedoutk  6 หลายเดือนก่อน +3

      Glad you like them:D probably not that soon but I want to yes. Collisions is definitely necessary

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

    omg, your videos are amazing! I love that you don't try to hide the math but explain it, AWESOME!

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

      really glad you like them, thank you!

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

    Thanks for the video :)

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

      Thanks for your support in the comments :)

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

    Bro you are great. Keep up the good work.

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

    Great video as always.

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

    By the way, I located a copy of Grioli's book and I checked vs. Tonon. Equation (2) in Tonon's paper doesn't match Eq. (22) - Chapter X in Grioli's book. The problem is in the definition of that matrix rather than in the definitions of a, a', b, b' and c, c', which seem to be coherent between the two. In Grioli the inertia operator is [ [ a -c' -b' ], [ -c' b -a' ], [ -b' -a' c ] ], which is exactly what you would get from Eq (2) in Tonon by swapping b' and c' in the matrix, hence the mistake is in Eq (2) of Tonon's paper and Grioli has the correct version. The definitions of the elements a, a' etc. are correct and coherent in both sources. If you had to swap the definitions of b' and c' you would lose the symmetry with the respective b and c, which is definitely not correct.

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

      Ah really cool, thanks for sharing. I can see the symmetry argument. So it would be nicer if I swapped the variables b' and c' when plugging them into the matrix creation rather than swapping the values they compute, right? Though why would you say breaking the symmetry is definitely not correct?

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

      @@blackedoutkindeed, swapping b' and c' in the compute matrix rather than swapping their definitions, which breaks symmetry with the corresponding b and c terms, is the correct approach. I didn't understand why the upper and lower triangles in Tonon's matrix are different from Grioli's while the definitions of the corresponding terms are the same. Unless he is somehow using a left handed coordinate system, but would need to check.

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

      @@marcoghislanzoni I think it's just an error in the paper, so the Grioli definition that you mentioned is correct. I don't believe the handedness of the coordinate system could correct the error

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

    Such an awesome video!

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

      Thank you glad you like it

  • @samsaraAI2025
    @samsaraAI2025 8 หลายเดือนก่อน +2

    Thanks! Any video soon about free objects colliding in 3D space?

    • @blackedoutk
      @blackedoutk  8 หลายเดือนก่อน

      Can't say soon unfortunately because I've been busy lately. But I want to do it eventually

    • @monx
      @monx 6 หลายเดือนก่อน +1

      i'm curious too. subscribed

  • @grippgoat
    @grippgoat 2 หลายเดือนก่อน

    Seems like it'd be easier to just approximate it by slicing in to voxels, calculating the tensor for that as a point mass, and then adding them up. Could do the Center of Mass with the same data first, so you know what point to calculate the tensor relative to.

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

    Love it :))
    Please make more

    • @blackedoutk
      @blackedoutk  5 หลายเดือนก่อน

      Nice:D Planning to improve my time management, so I can finally start working on these again

  • @richardbloemenkamp8532
    @richardbloemenkamp8532 11 หลายเดือนก่อน +1

    Don' t forget to use your framework for some fun simulations and games. Myself I have played with pyBullet to make 4-legged-robots, spinning tops (check that you get precession and nutation correct), hopping robots and rockets and satellites in the past. There are still a few old videos on my YT channel if you like. I'm still interested in one day making a simulation of a hopping robot that can do a backflip.

    • @blackedoutk
      @blackedoutk  11 หลายเดือนก่อน +1

      I've looked into some of your videos, really cool :D I still need to figure out quite a few things before I could make something similar. But I definitely want to use my framework for having some fun with it in the end, my goal is to simulate a simplified car that I can drive and make a game with it where the player needs to solve puzzles

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

      @@blackedoutk Happy you liked it. Personally I'm much more impressed by your work. Good thing YT exists.

  • @ИванЛеу-щ9е
    @ИванЛеу-щ9е 7 หลายเดือนก่อน +3

    when will you upload next part?

    • @blackedoutk
      @blackedoutk  6 หลายเดือนก่อน +3

      I don't know sorry :/ I hope this year

  • @manfredbogner9799
    @manfredbogner9799 6 หลายเดือนก่อน +1

    Sehr gut

    • @blackedoutk
      @blackedoutk  5 หลายเดือนก่อน +1

      Zweimal sehr gut, ich werde zum Einserschüler:D vielen Dank

  • @erNCfffff
    @erNCfffff 4 หลายเดือนก่อน +1

    I learned so much than i see that only one minute had passes 💀

  • @alex-unofficial
    @alex-unofficial 5 หลายเดือนก่อน

    Question(/Suggestion?):
    since you can already create a tetrahedral mesh, couldn't you implement the Inertia Tensor calculation by the following procedure?
    1. for each tetrahedron i in the tetrahedral mesh calculate the Inertia Tensor I_i like you describe in the video (I am assuming the origin is then arbitrary)
    2. then for each I_i recenter it from the arbitrary origin to the CoM, as you described for the total inertia tensor
    3. finally add each inertia tensor i to get the total inertia tensor I0 for the mesh.

    • @blackedoutk
      @blackedoutk  5 หลายเดือนก่อน

      I don't think this would work correctly because it's like pretending all of the tetrahedrons lie in the same position. Why do you want to recenter each tetrahedron instead of the result?

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

    hey do you know if software like solidworks do this in their inner workings? I mean in their source code

  • @pawcijo
    @pawcijo 5 หลายเดือนก่อน

    Have you thought about switching to vulkan (Molten VK) ? openGl is kinda dead on macos :/

    • @blackedoutk
      @blackedoutk  5 หลายเดือนก่อน +2

      I thought about it sometime but don't really want to do it because development would be even more time consuming. Vulkan requires more code than OpenGL for the same result and seems to be more lower level, so not only does writing the code take more time, I also need to learn how to even do the lower level programming.
      If I had all of this time I would want to try it but I'm already struggling creating these videos. It saddens me too that OpenGL restricted on MacOS and dying but so far it's still the easier way to get graphics on the display for me. Maybe that will change at some point but idk

  • @shivanshuraj7175
    @shivanshuraj7175 4 หลายเดือนก่อน

    When you will release library?

    • @blackedoutk
      @blackedoutk  4 หลายเดือนก่อน

      you mean release as in make a release? that will probably be a long time in the future because I have barely added anything. but if you just want to look at the code you can check out the link in the description of this video

    • @shivanshuraj7175
      @shivanshuraj7175 4 หลายเดือนก่อน

      @@blackedoutk I wanted to use your physics engine.since it's not ready then suggest me one..that is simple and less verbose

    • @blackedoutk
      @blackedoutk  4 หลายเดือนก่อน

      @@shivanshuraj7175 hmm I don't know if I can help you really. the only 3D physics engine I have ever used is bullet. I can't say if it's good or bad compared to others because I have nothing to compare it to and also I haven't even done anything significant with it

  • @samrubenabraham6979
    @samrubenabraham6979 5 หลายเดือนก่อน

    Minecraft is OP ngl. Despite having just cubes y'all get a lot to make in there lmao. But ngl, I should soon try game dev with your videos

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

    Can GPU be used for physics computations?

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

      Most likely yes using compute shaders for example. But if it‘s worth it depends on how effectively you can parallelize it. Might be hard when having to handle collisions. Haven‘t really tried it so far, so not sure

  • @playakilla4513
    @playakilla4513 4 หลายเดือนก่อน

    An welcher Uni hast du das lernen können? Bei mir wird sowas leider nicht angeboten... Bin aus Nürnberg

    • @blackedoutk
      @blackedoutk  4 หลายเดือนก่อน

      Ich hab eine Vorlesung an der JGU besucht, bei der es allgemein um ein paar Themen aus der Computeranimation ging (wie Hüllkörperhierarchien, physikalische Gesetzmäßigkeiten und kinematische Ketten) und eine an der TU Darmstadt, die nur Echtzeit-Physiksimulation behandelt hat. Durch die erste Vorlesung habe ich ein erstes Verständnis von den physikalischen Größen in der Simulation und dem mathematischen Umgang mit Matrixgleichungen bekommen. Dort bin ich auch auf XPBD gestoßen. Die zweite Vorlesung hatte nichts mit XPBD zu tun, aber behandelte Simulationsmethoden, die XPBD bezogen auf die Ergebnisqualität vermutlich sogar überlegen sind.
      Ich bin auf jeden Fall dankbar, dass mir diese Vorlesungen angeboten wurden, aber es ist auch viel Eigenarbeit in meinem Lernprozess dabeigewesen. Gleichungen, die der Prof umgeformt hat oder auch Umformungen aus dem XPBD Paper mal selbst durchzuführen und die Schritte im Detail nachzuvollziehen. Die Inhalte in diesem Video beispielsweise waren abgesehen von den mathematischen Grundlagen kein Teil der beiden Veranstaltungen. Oder auch die Volume und Bending Constraints aus Episode 2 und 3 wurden nur kurz erwähnt in einer Vorlesung, dass es die gibt. Die genauen Herleitungen habe ich dann selber mithilfe der Paper, yt Videos und mathematischen Regeln durchgeführt.
      Ich sag das nicht um mich selbst zu loben oder so, sondern um eine Perspektive zu geben, was man von solchen Veranstaltungen erwarten kann. Die Vorlesungen geben einem praktisch eine manchmal sogar recht kleine Grundlage und daraus kann man sich dann weiterentwickeln.
      Bist du an der FAU? Ich hab mal in das Modulhandbuch für den Bachelor of Science Informatik reingeschaut und es gibt in der Vertiefungsrichtung Visual Computing eine Vorlesung "Physically-based Simulation in Computer Graphics". Hast du das schon gesehen? Würd dir auf jeden Fall empfehlen das mal anzuschauen.

    • @playakilla4513
      @playakilla4513 4 หลายเดือนก่อน

      @@blackedoutk Danke für die ausführliche Antwort! Bin im Maschinenbaumaster. Und darf leider keine VL besuchen von den Informatikern. Aber ich halt mir das mal im Hinterkopf. Danke dir!!

    • @blackedoutk
      @blackedoutk  4 หลายเดือนก่อน +1

      @@playakilla4513 Gerne, freut mich wenn ich helfen kann. Dass du das nicht wählen kannst ist natürlich doof, aber sonst würd ich vorschlagen setz dich einfach so rein und frag vllt einen Studenten dort, ob er dir die Übungsblätter zukommen lässt. Natürlich nur, wenn du dadurch keinem den Platz wegnimmst

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

    hey can you please make a videoon how to configure opengl on mac

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

      It seems like your comment popped up twice, may I delete this one?

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

    Do you have discord channel?

    • @blackedoutk
      @blackedoutk  5 หลายเดือนก่อน

      yes, it's in the video description

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

    hey can you please make a videoon how to configure opengl on mac

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

      Hi, I don't think there is that much setup to do such that it would be worth making a video about. If I remember correclty you only have to install Xcode. After that you can try out the SDL template that I have on my github github.com/blackedout01/sdl-gl-template. The instructions to build and run are in the readme file on that page. You are also welcome to join my discord server, where I or other members could offer more detailed help. A link is in the description of this video.