CodingTrain / CodingTrain/Suggestion-Box

Coding Challenge: GJK algorithm

Aperta
#999 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Nessun dato sulla lingua
Stelle
570
Fork
85
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The [Gilbert-Johnson-Keerthi algorithm](https://en.wikipedia.org/wiki/Gilbert%E2%80%93Johnson%E2%80%93Keerthi_distance_algorithm) (known as GJK) is apparently a highly efficient and commonly used method for determining if 2 arbitrary **convex** polygons intersect. From my recent research into it, it seems that a number of papers and articles written about it make it seem more difficult than it is by obfuscating the algorithm with a lot of complicated math. A [video explaining the algorithm](https://caseymuratori.com/blog_0003) was recommended in the book _Game Engine Architecture_ (Jason Gregory), and this video is also linked to on the wikipedia article discussing the algorithm.

I'm proposing that you implement this algorithm as a coding challenge for a few reasons:

1. It's a somewhat 'difficult' algorithm, but not ridiculously so, making it a challenge that's within reach for the majority of your audience. It's also surprisingly ingenious.
2. The functionality would be very useful. I suspect a lot of the folks watching Coding Train are at least somewhat interested in making games and so could benefit from learning about algorithm for doing "collision detection" besides circle-circle and AABB-AABB. No doubt the GJK is also useful for non-gaming sketches. I'm personally interested in using it for a shape-packing sketch, for example.
3. ???
4. Fun!

For simplicity and to make it more useful as a teaching aid, implementing only the 2D case would be enough. Then you don't have to go through the trouble of dealing with all the extra checks required for a tetrahedron.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

No implementation files, entry points, or tests are named. Start by reading the linked Wikipedia article and Casey Muratori video, then define the scope for a 2D GJK coding challenge; done means the challenge implements convex-polygon intersection detection.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Ambito
game-dev
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.