Triangle vs. Box Collision Detection Theory | Coding Geometry Dash in Java #24
In this tutorial, I go over the mathematics and theory behind how to detect if a collision is occuring between a box and a triangle. For this tutorial I use to techniques, the first is rotating points about an origin, this is so that the triangle and box are aligned along the same coordinate axes, then I go over using Bresenham's line algorithm to detect a collision. Cohen Sutherland Algorithm is a clipping algorithm that was used for CPU graphics in the 80's and 90's, but it can be applied to this problem to determine whether a triangle is "clipping" a box.
Source for Rotation: http://www.sunshine2k.de/articles/RotationDerivation.pdf
Ptolemys Theorem: https://en.wikipedia.org/wiki/Ptolemy%27s_theorem
Cohen Sutherland Algorithm: https://www.geeksforgeeks.org/line-clipping-set-1-cohen-sutherland-algorithm/
---------------------------------------------------------------------
Website: https://ambrosiogabe.github.io/
Github: https://github.com/ambrosiogabe
Outro Music: https://www.bensound.com/royalty-free-music