Spike wrote: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.
Ok, this is a great start. I can visualize that so I bet taking a look at the source to either QBSP or one the map editors with the above explanation I can get what is happening here.
At least I get the general idea. That's rather interesting. And makes sense. So this is why concave brushes are illegal.
remember: dot(point, planenormal) - planedist = 0;
I've seen that kind of calculation more than a few times. I can sort of wrap that around my head and sort of not.
The normal is one of the 2 angles perpendicular to the plane. That equation is something about figuring out whether or not it is the near side of the plane or the far side of the plane using distance to the plane.
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)!
I think I've got enough to work with to start reading some code. Definitely in a much better position with that explanation. Once I figure this out, yeah that'll be great that I might have a shot at understand decal clipping and so forth. Thanks!
I'm probably only 8-9 concepts of 3D math away from being able to do some interesting stuff. I have to work through this kind of stuff on my own, but greatly appreciate the general description of what's going on which is not obviously commented in the code much of the time. I think these days clues to what something is doing is more helpful than anything.