So while researching for a method to detect collisions in a 3D space between (arbitrary rotated) boxes, I stumbled upon this excellent question with great resources for my further research and great answers: How many and which axes to use for 3D OBB collision with SAT
I now managed to implement nearly everything in C++, and I understand why I have to check all 15 axis and why they are important. Yet I don't understand, how to calculate a0, a1, a2, b0, b1 and b2 (the normals of A and B). Since I only have cuboids for collision detection, I would rather use normals instead of the edges. It does seem to be easier.
To be more precise: First of all, my data structure to save a OBB is a loose collection of 8 vertices of the cuboid 1]. I understand, how to calculate a normal mathematically. I just calculate the cross product of two edges... But I don't know which two edges to choose. If I look at a face of the cubiod, I have 4 edges I could use to calculate the normal for that face. Another problem is, that using the above mentioned data structure, I can't tell whether two vertices belong to one face.
So what can I do to get the 3 normals of a cuboid programmatically?
Do I have to expand my data structure, or can the missing information be derived somehow in a easy way?
1] Example for a cuboid in my data structure (represented in JSON, with (x,y,z) being a point in double^3):
[(0,0,0), (0,1,0), (1,0,1), (1,1,1), (0,1,1), (1,1,0), (1,0,0), (0,0,1)]