BSP Confusion

Started by
1 comment, last by Zeugmal_EDI 19 years, 3 months ago
I've been reading alot about BSP trees lately, and I think I understand the basic concept. The details, however, really confuse me. All the tutorials I've read talk about using a plane to split the polygons into smaller and smaller sections recursively. Apparently the plane to use is chosen from the list inherited from the previous split. What I don't understand is how to construct a plane from a polygon. Perhaps it's obvious, but I'm somewhat weak on the math. If anybody could help me w/this problem, I'd appreciate it alot.
Zach Todd,Ethereal Darkness Interactive,Scripter/Writer
Advertisement
A plane consists of a normal, and a 'distance from the origin'. A polygon has a normal already, so you have 3/4 (in 3D) of the numbers you need for the plane. The distance is calculated using the plane equation (Ax + By + Cz + D = 0)
You have a point on the plane already (any vertex from the polygon is on the plane), and the (A,B,C) = the normal, so you plug in the values for the point and get D = -(Nx*Px + Ny*Py + Nz*Pz) where N is the polygon's normal and the P is any point on the polygon (a vertex is an easy one since you have it already).
In other words, D is equal to -(N . P) where . is the dot product

Some handly links for this kind of stuff:
Geometry
Math World
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Thanks for the info. I've got a better idea of what's going on now. Good links too.
Zach Todd,Ethereal Darkness Interactive,Scripter/Writer

This topic is closed to new replies.

Advertisement