Closet points between two line.
Does anybody out there know how to find the two closest points between two lines in 3D space? If you do please tell me how!
One by one, the peguins steal my sanity.
One by one, the peguins steal my sanity.
This question was posted about a week or so ago. Check the archives

Check out the Siggraph (2002) paper by Bridson, Fedkiw, and Anderson called "Robust Handling of Collision, Contact and Friction for Cloth Animation". It shows how find the two closest points on the lines.
- Mikko Kauppila
- Mikko Kauppila
well, if you had a line connecting these two other lines at their closest points, it would be perpendicular to both lines...
You could do some math (linear algebra maybe) to find a plane for which one of the lines is a normal vector, and the other is "in" the plane, and the place where the plane intersects the "normal" line is the point on that line, and then you''d find the distance on the plane between the two lines
that might be a little complicated though
You could do some math (linear algebra maybe) to find a plane for which one of the lines is a normal vector, and the other is "in" the plane, and the place where the plane intersects the "normal" line is the point on that line, and then you''d find the distance on the plane between the two lines
that might be a little complicated though
quote:
Original post by uutee
Check out the Siggraph (2002) paper by Bridson, Fedkiw, and Anderson called "Robust Handling of Collision, Contact and Friction for Cloth Animation". It shows how find the two closest points on the lines.
- Mikko Kauppila
Thanx, but I don''t suppose you have the URL?
One by one, the peguins steal my sanity.
One by one, the peguins steal my sanity.
I've not read other message but, I did it.
compute the crossproduct(PerpendicularDir) of both lines, this is the perpendicular line to the 2 lines.
Then make a plane for each line from these 3 points: LinePt1 , LinePt2 and LinePt1 + PerpendicularDir;
Then compute intersection point of the line and the plane. this is the ClosestPoint for this line. Same thing for second line.
Fantasio.
[edited by - fantasio on December 2, 2002 3:24:58 PM]
compute the crossproduct(PerpendicularDir) of both lines, this is the perpendicular line to the 2 lines.
Then make a plane for each line from these 3 points: LinePt1 , LinePt2 and LinePt1 + PerpendicularDir;
Then compute intersection point of the line and the plane. this is the ClosestPoint for this line. Same thing for second line.
Fantasio.
[edited by - fantasio on December 2, 2002 3:24:58 PM]
quote:
Original post by Fantasio
I''ve not read other message but, I did it.
compute the crossproduct(PerpendicularDir) of both lines, this is the perpendicular line to the 2 lines.
Then make a plane for each line from these 3 points: LinePt1 , LinePt2 and LinePt1 + PerpendicularDir;
Then compute intersection point of the line and the plane. this is the ClosestPoint for this line. Same thing for second line.
Fantasio.
[edited by - fantasio on December 2, 2002 3:24:58 PM]
Thanx a LOAD. That sounds pretty easy when you put it like that. I''ll give it a go!

One by one, the peguins steal my sanity.
One by one, the peguins steal my sanity.
quote:
Original post by Fantasio
I''ve not read other message but, I did it.
compute the crossproduct(PerpendicularDir) of both lines, this is the perpendicular line to the 2 lines.
Then make a plane for each line from these 3 points: LinePt1 , LinePt2 and LinePt1 + PerpendicularDir;
Then compute intersection point of the line and the plane. this is the ClosestPoint for this line. Same thing for second line.
Fantasio.
Somebody tell me if I''m off my rocker. I haven''t tried it, but:
Define line #1 as a point p1 and a unit vector v1.
Ditto for line #2
p1 + v1*dot(v1, p2-p1) // closest point on line #1
p2 + v2*dot(v2, p1-p2) // closest point on line #2
And I think I''m remembering my vector math right.
Aaargh! Everyone save your workspaces before your program locks up your computer!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement