Generate 2D cross-section polygon from 3D mesh
- by nornagon
I'm writing a game which uses 3D models to draw a scene (top-down orthographic projection), but a 2D physics engine to calculate response to collisions, etc. I have a few 3D assets for which I'd like to be able to automatically generate a hitbox by 'slicing' the 3D mesh with the X-Y plane and creating a polygon from the resultant edges.
Google is failing me on this one (and not much helpful material on SO either). Suggestions?