Line-Line Intersection in 3D
Hi,
does anyone know how I can test if a Line intersects with an other Line in 3D??? (Each line has only 2 Points.)
Au''revoir,
Aya~
Bad idea to do line-line intersection, as it''s subject to floating point error. Your options:
1. cylinder-line intersection, which''ll tell you whether the lines are "close enough" to each other.
2. line-line distance, which''ll tell you how close they are.
3. Plucker coordinates, which''ll tell you which "side" of one line the other line is on. If it''s different than before, the lines intersected at some point.
Which you choose depends heavily on what you''re actually trying to do. So: What are you actually trying to do?
How appropriate. You fight like a cow.
1. cylinder-line intersection, which''ll tell you whether the lines are "close enough" to each other.
2. line-line distance, which''ll tell you how close they are.
3. Plucker coordinates, which''ll tell you which "side" of one line the other line is on. If it''s different than before, the lines intersected at some point.
Which you choose depends heavily on what you''re actually trying to do. So: What are you actually trying to do?
How appropriate. You fight like a cow.
Hi,
ok... line-line distance is the best I think..
Did you know how to calculate this??
Au''revoir,
Aya~
ok... line-line distance is the best I think..
Did you know how to calculate this??
Au''revoir,
Aya~
quote:Original post by AyaKoshigaya
Hi,
ok... line-line distance is the best I think..
Did you know how to calculate this??
Au''revoir,
Aya~
Yeah..... but I posted it recently, so you should be able to search for it. The basic idea is to find the projection of the intersection onto the plane that both lines are parallel to, then back-track that projection to the points on each line, then compute the distance between them.
How appropriate. You fight like a cow.
if one line contains A and B, while the other C and D:
(pseudocode)
dist=normalize(AB x CD) . AC
You can use any points instead of A and C which are on each line respectively.
(pseudocode)
dist=normalize(AB x CD) . AC
You can use any points instead of A and C which are on each line respectively.
The only problem is if he meant line segments, in which case you can''t do just a line-line distance check. Any two coplanar line segments will give you a zero distance, but they might not always intersect.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement