When re-reading Real-Time Collision Detection by Christer Ericson i came across a section called Determinant Predicates in Chapter 3 A Math and Geometry Primer. I thought it was interesting that from just filling a matrix with data such a points in space and finding the determinate of that matrix you could do geometrical tests. Although the tests are not the most efficient ways for solving the problems outlined here i just wanted to make an implementation in C++ to test it myself.
If you have ever played any polished game where there is specular reflections of the game world, it was probably implemented with environment maps. An environment map can be implemented as a 6 textures mapped to the inner surface of a cube at infinity distance centered on the object being rendered.
So when learning OpenGL i decided that i would write my own Math classes instead of using a math library such as glm. I always enjoy trying to use as few library as possible and having to write it myself as a fun challenged. A lot of people ask me why i would bother, just use an existing library, for me, It’s just fun! Continue reading “OpenGL Math”
Lets say you have three equations with 3 unknowns:
- x + y + z = -5
- x -4y + z = 35
- x – 3y + 4z = -18
The separating axis theorem is one of the most useful things to know when programming collision detection. The separating axis shows that if you project the extents of the convex object in the direction of the axis and they do not overlap, then they do not intersect. If they do overlap and the objects are convex then the objects intersect.