Raven September 07, 1999, 06:20 PM 

First, i'll give you a math overhaul, then i'll give you the actual working example:
You find the parameter t of the line at the plane by the following equation:
t=(qDP1)/(DP2DP1)
where:
t > is the line parameter at the intersection q > is the free component in the plane equation(see below) DP1 > is the dot product of the beginning of the line with the plane normal DP2 > is the dot product of the end of the line with the plane normal
Explanation of equations:
a line segment can be defined analytically as:
P1+(P2P1)t=0
where:
P1, P2 > the beginning and end points of the segment, respectively t > the parameter(a number from 0 to 1)
a plane is defined by:
Ax+By+Cz+q=0, or in vector math: Np+q=0
where:
N > the normal vector. N=(A, B, C) q > the free component(see above)
now, to put all this to work(pseudocode, but this works, it's cut/pasteed right out of my engine with dereferencing and all):
t=(Plane>qDotProd1)/(DotProd2DotProd1);
Vert1>x=Vert1>x+(Vert2>xVert1>x)*t; Vert1>y=Vert1>y+(Vert2>yVert1>y)*t; Vert1>z=Vert1>z+(Vert2>zVert1>z)*t;
so much for coordinates, but you ask why didn't we just plug in the line equation into the plane equation? this is why:
// Color Vert1>r=Vert1>r+(Vert2>rVert1>r)*t; Vert1>g=Vert1>g+(Vert2>gVert1>g)*t; Vert1>b=Vert1>b+(Vert2>bVert1>b)*t; Vert1>a=Vert1>a+(Vert2>aVert1>a)*t;
// Texture Vert1>TexCoords.s=Vert1>TexCoords.s+(Vert2>TexCoords.sVert1>TexCoords.s)*t; Vert1>TexCoords.t=Vert1>TexCoords.t+(Vert2>TexCoords.tVert1>TexCoords.t)*t;
And it magically clips a line and all of its parameters to a plane! Now, if this doesn't work then make sure your t is between 0 and 1.
As to BSPtrees, here's a link to get a nice crash course in them:
http://24.112.84.101/tutorials/index.shtml
This has several tutorials on interesting stuff(like radiosity), and the guy even wrote a column for flipcode. Overall this gives a great crashcourse in these areas, but you still need to do some research to actually get a live engine out of it. Like a person smarter than me said(and there's a lot of those, ohoh!) no pain no gain:)
