I want to know the area of a 3D triangle inside an axis-aligned bounding box (AABB). I have already determined how to efficiently detect a collision between the triangle and AABB using the method presented here:
http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/pubs/tribox.pdf
However, I have not found a good algorithm for computing the area of the triangle inside of the AABB. If I were to self-roll a solution, it would look like:
- Detect tri-AABB overlap
- Test is triangle is inside AABB -> return area
- For each side of the AABB, make a plane
- Clip the triangle for each of the 6 generated planes. If more than 3 side result from the clip make into new triangles
- Loop through new triangle set and goto #2 until no triangle are left in the set
I think this should result in a set of triangles all inside the AABB, and therefore, the sum of their area is the area of the base triangle inside the AABB?
I would probably: