Help on intersections...

Help on intersections...

Post by Jocelyn Legaul » Sat, 26 Sep 1998 04:00:00



Hello All...

    I need a bit of help on intersection between a plane and line.  I went
to the FAQ, and found this:

Subject 5.05: How do I find the intersection of a line and a plane?
    If the plane is defined as:
        a*x + b*y + c*z + d = 0
    and the line is defined as:
        x = x1 + (x2 - x1)*t = x1 + i*t
        y = y1 + (y2 - y1)*t = y1 + j*t
        z = z1 + (z2 - z1)*t = z1 + k*t
    Then just substitute these into the plane equation. You end up    with:
        t = - (a*x1 + b*y1 + c*z1 + d)/(a*i + b*j + c*k)
    When the denominator is zero, the line is contained in the plane
    if the numerator is also zero (the point at t=0 satisfies the
    plane equation), otherwise the line is parallel to the plane.

Humpf....  That doesn't help me much!  The plane I have is defined by 3
points in space and the line defined by 2 others.  From that, how do I move
the the equations up here?  Plus, I don't want to have to solve an equation
each time I want to find the intersection between a line and a plane.
    In fact, the bottom line is does anyone knows an *algorithm* that does
that....

Thank you

Jocelyn Legault

 
 
 

Help on intersections...

Post by Samuel P. Uselt » Sat, 26 Sep 1998 04:00:00



> Hello All...

>     I need a bit of help on intersection between a plane and line.  I went
> to the FAQ, and found this:

> Subject 5.05: How do I find the intersection of a line and a plane?
>     If the plane is defined as:
>         a*x + b*y + c*z + d = 0
>     and the line is defined as:
>         x = x1 + (x2 - x1)*t = x1 + i*t
>         y = y1 + (y2 - y1)*t = y1 + j*t
>         z = z1 + (z2 - z1)*t = z1 + k*t
>     Then just substitute these into the plane equation. You end up    with:
>         t = - (a*x1 + b*y1 + c*z1 + d)/(a*i + b*j + c*k)
>     When the denominator is zero, the line is contained in the plane
>     if the numerator is also zero (the point at t=0 satisfies the
>     plane equation), otherwise the line is parallel to the plane.

> Humpf....  That doesn't help me much!  The plane I have is defined by 3
> points in space and the line defined by 2 others.  From that, how do I move
> the the equations up here?  Plus, I don't want to have to solve an equation
> each time I want to find the intersection between a line and a plane.
>     In fact, the bottom line is does anyone knows an *algorithm* that does
> that....

> Thank you

> Jocelyn Legault

Elsewhere in the FAQ there is an explanation of how to get the plane
equation from a set of points in the plane (minimum of three non-colinear
points required).  The basic idea is (1) take the difference of pairs of
points to get two vectors in the plane.  (2) Compute the cross product
of these two vectors, which when normalized, give you the a, b and c of
the plane equation.  Use one of the original points for x, y, z in the
plane equation and what's left is (some number) + d = 0.  In other words,
the number is = -d.

The line equations are easier.  The two points defining your line are
(x1, y1, z1) and (x2, y2, z2) in the three equations.  t is a parameter
indicating particular positions along the line. t = 0 is p1, t = 1 is p2,
t between 0 and 1 is on the line between the defining points.  t < 0
and t > 1 are points on the line but beyond one or the other endpoint.

So...

by finding t in the last equation, you have found where along the line
the intersection occurs.  Substituting that value for t into the line
equations gives you the (x, y, z) coordinates you want.

The algorithm is just to do those steps:

find the plane equation
find t of the intersection
find the (x, y, z) of the intersection.



 
 
 

Help on intersections...

Post by Jeff Kesselm » Sun, 27 Sep 1998 04:00:00


On Fri, 25 Sep 1998 08:51:43 -0400, "Jocelyn Legault"


>Humpf....  That doesn't help me much!  The plane I have is defined by 3
>points in space and the line defined by 2 others.  From that, how do I move

 For how to find a plane from 3 points,
        (a) Find the normal. Thsi gives you A, B and C  (x,y and z
respectively of the normal)
        (b) Performa  dot product of the normal and any point in the
plane, this gives you -D, simply invert the sign to get D.

Quote:>the the equations up here?  Plus, I don't want to have to solve an equation
>each time I want to find the intersection between a line and a plane.

I dont follwo you here. Thsi isnt a system of equations that you
showed above, its just a  formula.  Thats goigj to be one hell of a
lot faster then any interative approximatio nand test technqiue. (And
for this problem i doubt one exists.)

You can't do 3D graphics (or even 2D graphics to any great extent)
without doing math.

JK

 
 
 

1. Help on intersection...

Hello All...

    I need a bit of help on intersection between a plane and line.  I went
to the FAQ, and found this:

Subject 5.05: How do I find the intersection of a line and a plane?
    If the plane is defined as:
        a*x + b*y + c*z + d = 0
    and the line is defined as:
        x = x1 + (x2 - x1)*t = x1 + i*t
        y = y1 + (y2 - y1)*t = y1 + j*t
        z = z1 + (z2 - z1)*t = z1 + k*t
    Then just substitute these into the plane equation. You end up    with:
        t = - (a*x1 + b*y1 + c*z1 + d)/(a*i + b*j + c*k)
    When the denominator is zero, the line is contained in the plane
    if the numerator is also zero (the point at t=0 satisfies the
    plane equation), otherwise the line is parallel to the plane.

Humpf....  That doesn't help me much!  The plane I have is defined by 3
points in space and the line defined by 2 others.  From that, how do I move
the the equations up here?  Plus, I don't want to have to solve an equation
each time I want to find the intersection between a line and a plane.
    In fact, the bottom line is does anyone knows an *algorithm* that does
that....

Thank you

Jocelyn Legault

2. Need a ctk.exe for a NT machine! (For porting purposes)

3. Help: performer intersection

4. image warping

5. Help: Polygon Intersection, Merge algorithms

6. WANTED s/w for shaded relief

7. Please, help with intersections of two spheres

8. newbiee question (sorry :)

9. --HELP-- Find intersection point

10. HELP : Polygon intersection?

11. Help: simple intersections/bouncing

12. HELP: Finding intersection of two line segments

13. Help -- circle intersection algorithm sought