Having two 3D cubes/cuboids, each defined by their different vertices (p1, p2, p3, p4, p5, p6, p7, p8), how can I find the minimum distance between the cubes?
I have been working on a simple Euclidean 3D distance algorithm with the min and max of each cube but it doesn't work for rotated cubes. Is there any overall method for this problem? In this picture there are two examples of the two cubes and possible positions where I want to calculate the minimum distance:
