• Create Account

#Actualclb

Posted 20 May 2012 - 11:47 PM

When doing computational line-line tests in 3D using floating point, the typical path is as follows:

1. Compute the closest pair of points on both lines. See e.g. MathGeoLib. (link to code).
2. If their distance is smaller than some arbitrary small threshold value (e.g. 0.001f), consider the lines intersecting, false otherwise. Vector distance.

The threshold value effectively transforms the two lines into infinitely long cylinders, and tests them for collision.

Edit: As pointed out below, just noticed the question was for determining intersection between a pair of line <b>segments</b>. For that case, the same method above is used, but computing the closest point pairs in #1 requires clamping the points onto the line segment range. See LineSegment::ClosestPoint(LineSegment) (code) in MathGeoLib.

#1clb

Posted 20 May 2012 - 08:20 AM

When doing computational line-line tests in 3D using floating point, the typical path is as follows:

1. Compute the closest pair of points on both lines. See e.g. MathGeoLib. (link to code).
2. If their distance is smaller than some arbitrary small threshold value (e.g. 0.001f), consider the lines intersecting, false otherwise. Vector distance.

The threshold value effectively transforms the two lines into infinitely long cylinders, and tests them for collision.

PARTNERS