I'm implementing octrees which will contain a list of triangles. While the implementation is quite obvious I just keep wondering: what is a good algorithm to test whether a triangle is inside a cube? I've done quite a lot of googling, but every resource skips over this part.
I could probably think of a really crappy way (testing every possible situation on the relative position of the triangle). But there must be a better way.
Another resource said that you could transform the cube into a voxel and then said there was an algorithm to detect the intersection between the two, though it was a reference to a book I don't have.
Thanks in advance