by Spike » Thu Jan 26, 2012 6:16 pm
aye, its a plane/pain...
anyway, figure out the plane equation, figure out the s and t vectors (doesn't actually need to be the ones specified, just use some random directions so long as they're perpendicular to the normal), generate an absolutely massive quad using those s and t vectors, then clip that quad against the other planes in the brush. This should get you usable geometry for each face.
remember: dot(point, planenormal) - planedist = 0;
by calculating the value at two verts, you know the plane cuts the edge if one is negative and one is positive. you can then calculate the the fraction along the line based upon their relative magnitudes, and interpolate them to find the point where it intersects. you just have to trim away the extra verts beyond the boundary.
You might want to keep that poly/planes clipping code - it could be useful for clipped decals too (where you take the entire world and clip away anything too far from the center)!
.