# Thread: find intersecting line between 2 planes

1. hello, i'm trying to implement an interval overlap triangle-triangle collision detection method for a space combat simulator i'm working on, based on this

this is how far i got.

"triangle1"
U0 = \$triangle1.verts.pos
U1 = \$triangle1.verts.pos
U2 = \$triangle1.verts.pos
"triangle2"
V0 = \$triangle2.verts.pos
V1 = \$triangle2.verts.pos
V2 = \$triangle2.verts.pos

"normal2"
normvector = cross (V1-V0) (V2-V0)
n2 = normalize normvector

d2 = dot -n2 V0
"signed distances"
n2*U0+d2
n2*U1+d2
n2*U2+d2

however, i'm struggling with creating the point O in the formula
L = O+tD. i managed to get tD from the formulas, but there doesn't seem to be an explanation on how to get O. what it tells me is that O is a point on the line where the planes cross.  2.

3. Without checking that link for now, I thought I should point out that the usual way of doing collision detection is with the separating axis theorem. If you project one triangle onto the normal of the other, there should be a gap, which is easy to check since it's then 1D. (Of course, when you have an object composed of a bunch of triangles, things can get a little more complex.)  4. Originally Posted by MagiMaster
Without checking that link for now, I thought I should point out that the usual way of doing collision detection is with the separating axis theorem. If you project one triangle onto the normal of the other, there should be a gap, which is easy to check since it's then 1D. (Of course, when you have an object composed of a bunch of triangles, things can get a little more complex.)
well, this works like SAT, but on a per-triangle basis. what i need the axis for is to project the points of the triangles so that the line segments of the triangles can be compared, on the 1D line where the planes intersect.  5. http://en.wikipedia.org/wiki/Plane_(geometry)#Line_of_intersection_between_two_ planes
wiki seems to have something. now i just need to understand what that something is
:P  6. hum, well, tried implementing this:

http://paulbourke.net/geometry/planeplane/

but seems like it's 2-dimensional (if c1 and c2 are x and y coordinates.. urrh)

"triangle1"
U0 = \$triangle1.verts.pos
U1 = \$triangle1.verts.pos
U2 = \$triangle1.verts.pos
"triangle2"
V0 = \$triangle2.verts.pos
V1 = \$triangle2.verts.pos
V2 = \$triangle2.verts.pos

"normal triangle1"
normvector1 = cross (U1-U0) (U2-U0)
n1 = normalize normvector1
"d1"
d1 = dot -n1 U0

"normal triangle2"
normvector2 = cross (V1-V0) (V2-V0)
n2 = normalize normvector2
"d2"
d2 = dot -n2 V0

"D direction of line"
d = cross n1 n2

"signed distances"
n2*U0+d2
n2*U1+d2
n2*U2+d2

determinant = (dot N1 N1)*(dot n2 n2)-(dot n1 n2)^2

"possibly an arbitrary point on the line"
c1 = (d1*(dot n2 n2)-d2*(dot n1 n2))/determinant
c2 = (d2*(dot n1 n1)-d1*(dot n1 n2))/determinant  7. finally found something that worked!

normal a = [1,1,4]
normal b = [3,1,1]

determinant = cross a b = [-3,11,-2]

t=1

x= -3.*t
y = 11.*t+4./3.
z = (-2.*t)+5./3.  8. hum, no still stuck :x

normal1 = [1,1,4]
normal2 = [3,1,1]

"direction of the intersecting line"
determinant = cross normal1 normal2

t=1
"point on the intersecting line"
x= -3.*t
y = 11.*t+4./3.
z = (-2.*t)+5./3.

need to figure out how he got 4/3 and 5/3  Bookmarks
 Posting Permissions
 You may not post new threads You may not post replies You may not post attachments You may not edit your posts   BB code is On Smilies are On [IMG] code is On [VIDEO] code is On HTML code is Off Trackbacks are Off Pingbacks are Off Refbacks are On Terms of Use Agreement