Separating Axis Theorem (SAT) - Let's Make a Physics Engine [05]

Поділитися
Вставка
  • Опубліковано 21 лис 2024

КОМЕНТАРІ • 35

  • @boggo3848
    @boggo3848 2 роки тому +8

    Everyone trying to learn how to make their first physics engine is searching google madly to find all the confusing incomplete articles and stackoverflow posts instead of just finding this excellent video.

  • @CL-pg6iu
    @CL-pg6iu 3 роки тому +15

    This series is the absolute best resource for learning 2d physics systems. Thanks for making it, it really helped me alot!

  • @mikolaj78
    @mikolaj78 Рік тому +1

    Wow, I’m impressed! Even though english isn’t my first language, you make it so easy to understand.

  • @nimrodel973
    @nimrodel973 2 роки тому +5

    I'm so glad I've found your channel, I finally found someone that can explain this theorem in a way that I could understand, thank you very much!

  • @mihajlom1k1
    @mihajlom1k1 2 роки тому +3

    Am currently working on a project that uses SAT, was able to understand you and translate the code into python. Subbed

  • @misterius1
    @misterius1 Рік тому +2

    Thank you so much for the series! You helped me tremendously with my school project.

  • @tolgakonat1885
    @tolgakonat1885 Рік тому

    the best resources for learning sat i i have found, thanks!!!

  • @dameck9570
    @dameck9570 2 роки тому

    Great job on this video.
    I have tried to understand this theorem so many times, but you finally got me to actually understand it.
    I am following your tutorial series in java/Processing just because I wanna learn the physics-engine basics before I implement it into my render-engine.
    Keep it up man!

  • @catapillie
    @catapillie 3 роки тому +6

    been following around, this is pretty neat. thank you for making these videos!

  •  Рік тому

    Great serie. Thank you. Greetings from Popayan, Colombia.

  • @Lubisek
    @Lubisek 3 роки тому +3

    Pure gold. So many thanks for these.

  • @boreopithecus
    @boreopithecus Рік тому

    16:37 What is the reason for looping through verticesB? Isn't the first loop enough to determine if there is overlap? I tried without the second loop and collision detection still seems to work (borders turn red).
    Edit: OK, the answer was in the next video, it's for calculating the depth and the normal.

  • @anthonypace5354
    @anthonypace5354 Рік тому

    Very clear!

  • @itaymadeit6069
    @itaymadeit6069 2 роки тому

    First of all great video, but I have a question, do you think SAT can be good to 3d collision? thanks anyway and great video!

    • @two-bitcoding8018
      @two-bitcoding8018  2 роки тому +1

      I would say that there are probably better algorithms for 3D. In 3D I would probably look at "GJK": en.wikipedia.org/wiki/Gilbert%E2%80%93Johnson%E2%80%93Keerthi_distance_algorithm

    • @itaymadeit6069
      @itaymadeit6069 2 роки тому

      @@two-bitcoding8018 Thanks!!!

  • @Test-iv4pm
    @Test-iv4pm 2 роки тому

    Does the direction of the normal matter for this test?
    I am thinking that an axis doesn't really have a direction; it is just sort of a definition for an infinite line in space
    We are projecting each vertex onto that line, and I am thinking that it doesn't matter which way that line is pointing per say

    • @two-bitcoding8018
      @two-bitcoding8018  2 роки тому +1

      Yes! You are correct! We use the normal direction in later videos to resolve the collision in the correct direction. Pushing the shapes apart according to the direction of the normal or "axis."
      Thanks for the clarification!

  • @lukecronquist6003
    @lukecronquist6003 Рік тому

    Could you explain why this is better than checking intersecting lines + point in polygon?

    • @two-bitcoding8018
      @two-bitcoding8018  Рік тому

      I think the main advantage comes in the next step where we are able to easily obtain the normal of the collision from the separating axis.

    • @gmdrandom6287
      @gmdrandom6287 Рік тому

      @@two-bitcoding8018 Could line v line collisions potentially be faster than SAT collisions if there's a fast way to get the normal of collisions

  • @bamsgian9759
    @bamsgian9759 Рік тому

    Does it's work in 3 dimensional?
    In 2D it's easier to find overlaping vertices

    • @two-bitcoding8018
      @two-bitcoding8018  Рік тому +2

      This one is specifically 2d and yes it is easier in 2d. You can look up separating hyperplane theorem for possible use in 3d. But in 3d, I would probably use GJK.

    • @bamsgian9759
      @bamsgian9759 Рік тому

      @@two-bitcoding8018 just read and watch what is GJK, I still don't understand how to determinate direction

    • @two-bitcoding8018
      @two-bitcoding8018  Рік тому +1

      @@bamsgian9759 Here's a good resource: ua-cam.com/video/DGVZYdlw_uo/v-deo.html

  • @boom5935
    @boom5935 Рік тому

    How do i know the dot product?

    • @two-bitcoding8018
      @two-bitcoding8018  Рік тому +1

      Check out this video on my channel for dot product and other math for physics:
      ua-cam.com/video/TJVA2gKFxH0/v-deo.html

    • @boom5935
      @boom5935 Рік тому

      @@two-bitcoding8018 Thanks!

  • @cursedfox4942
    @cursedfox4942 Рік тому

    C sharp lol shit ahh well 😅