video thumbnail 31:52
A Strange But Elegant Approach to a Surprisingly Hard Problem (GJK Algorithm)

2021-03-24

[public] 89.8K views, 13.0K likes, 50.0 dislikes audio only

channel thumbReducible

In 1988, three engineers came together and developed one of the most clever solutions to the problem of detecting when two complex objects collide. Their solution, the Gilbert Johnson Keerthi (GJK) algorithm, named after the authors, made an incredible impact in the fields of robotics, control, and computer graphics. This video is about understanding this ingenious algorithm from first principles.

The video covers a broad range of topics from Minkowski sums and differences to support functions to the full implementation of the 2D GJK algorithm. But what I hope you get out of this is an appreciation of the incredible shifts in perspective that lead to the final algorithm. Coming up with the algorithm is an amazing feat and useful for specific applications, but the overarching problem solving techniques that come through in the journey to the solution is truly invaluable.

0:00 Introducing the Problem

2:02 Convexity

3:15 Infinite Point Perspective

4:07 Minkowski Sums and Differences

6:37 Triangles inside Minkowski Differences

7:41 Simplexes

8:57 Support Functions

13:05 Core GJK Algorithm: Broad Perspective

17:15 Remaining Key Questions

17:56 How to determine if a point passed the origin?

19:10 The line case

20:41 The triangle case

26:25 GJK Implementation

29:38 Recap and quick note about original GJK paper

This video is supported by a community of Patreons

Special Thanks to the following Patreons:

Burt Humburg

Justin Hiester

Michael Nawenstein

Richard Wells

Sebastian Gamboa

Zac Landis

There's a lot more to the GJK algorithm to learn for those interested. Here are some resources I recommend:

https://www.youtube.com/watch?v=Qupqu1xe7Io - a full walkthrough of how to implement GJK in 3D by Casey Muratori, the game developer/engineer that came up with some of the clever optimizations that I present in this video.

http://www.dyn4j.org/2010/04/gjk-gilbert-johnson-keerthi/ - a really nice writeup on GJK

https://www.youtube.com/watch?v=MDusDn8oTSE - A quick intro to GJK and an implementation in C++

https://www.toptal.com/game/video-game-physics-part-ii-collision-detection-for-solid-objects - solid resource for collision detection in general and goes deeper into the theory.

https://box2d.org/files/ErinCatto_GJK_GDC2010.pdf - an alternative perspective to GJK using barycentric coordinates -- I really wanted to cover this in this video, but it would have been an hour long instead of half an hour long so I'll compromise and give you this resource :)

Support: https://www.patreon.com/reducible

Twitter: https://twitter.com/Reducible20

This video wouldn't be possible without the open source library manim created by 3blue1brown: https://github.com/3b1b/manim

Here is link to the repository that contains the code used to generate the animations in this video: https://github.com/nipunramk/Reducible

Music attributions:

Midsummer Sky by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 license. https://creativecommons.org/licenses/by/4.0/

Source: http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100158

Artist: http://incompetech.com/

Luminous Rain by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 license. https://creativecommons.org/licenses/by/4.0/

Source: http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100169

Artist: http://incompetech.com/

Prelude No. 23 by Chris Zabriskie is licensed under a Creative Commons Attribution 4.0 license. https://creativecommons.org/licenses/by/4.0/

Source: http://chriszabriskie.com/preludes/

Artist: http://chriszabriskie.com/

All other tracks by Aakash Gandhi


Building Collision Simulations: An Introduction to Computer Graphics by Reducible
/youtube/video/eED4bSkYCB8
Dot products and duality | Chapter 9, Essence of linear algebra by 3Blue1Brown
/youtube/video/LyGKycYT2v0
Cross products | Chapter 10, Essence of linear algebra by 3Blue1Brown
/youtube/video/eu6i7WJeinw
Introducing the Problem
/youtube/video/ajv46BSqcK4?t=0
Convexity
/youtube/video/ajv46BSqcK4?t=122
Infinite Point Perspective
/youtube/video/ajv46BSqcK4?t=195
Minkowski Sums and Differences
/youtube/video/ajv46BSqcK4?t=247
Triangles inside Minkowski Differences
/youtube/video/ajv46BSqcK4?t=397
Simplexes
/youtube/video/ajv46BSqcK4?t=461
Support Functions
/youtube/video/ajv46BSqcK4?t=537
Core GJK Algorithm: Broad Perspective
/youtube/video/ajv46BSqcK4?t=785
Remaining Key Questions
/youtube/video/ajv46BSqcK4?t=1035
How to determine if a point passed the origin?
/youtube/video/ajv46BSqcK4?t=1076
The line case
/youtube/video/ajv46BSqcK4?t=1150
The triangle case
/youtube/video/ajv46BSqcK4?t=1241
GJK Implementation
/youtube/video/ajv46BSqcK4?t=1585
Recap and quick note about original GJK paper
/youtube/video/ajv46BSqcK4?t=1778
Patreon patreon.com
https://www.patreon.com/reducible
The Discrete Fourier Transform: Most Important Algorithm Ever? 24,277 views
/youtube/video/yYEMxqreA10
Reducible This channel is all about animating computer science concepts in a fun, interactive, and intuitive manner.
/youtube/channel/UCK8XIGR5kRidIw2fWqwyHRA