• Advertisement
Sign in to follow this  

BSP Confusion

This topic is 4796 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement