POV-Ray : Newsgroups : povray.advanced-users : Intersection test for triangles Server Time
30 Jul 2024 06:29:53 EDT (-0400)
  Intersection test for triangles (Message 6 to 15 of 15)  
<<< Previous 5 Messages Goto Initial 10 Messages
From: David Fontaine
Subject: Re: Intersection test for triangles
Date: 24 May 2000 18:26:19
Message: <392C5626.C0BC36B0@faricy.net>
John VanSickle wrote:

> Try this:
>
> Find the planes that contain each triangle; if they are parallel (but
> not coincident), the triangles do not intersect.
>
> Find the line along which the planes intersect.
>
> Find the part of the line that lies within the first triangle.  If the
> line lies out of the triangle, the triangles do not intersect.
>
> Find the part of the line that lies within the second triangle.  If the
> line falls out of the triangle, the triangles do not intersect.
>
> If the two resulting line segments overlap, the triangles intersect.
> Otherwise, they don't.
>
> Hope this helps,
> John

Wow, sounds like it will take a long time to parse. (I actually want it to
test cubes for intersection, but the faces can be considered two triangles,
and if the faces don't intersect the cubes don't. For the bowl-full-o-cubes
thing...)

--
David Fontaine     <dav### [at] faricynet>     ICQ 55354965
Please visit my website: http://www.faricy.net/~davidf/


Post a reply to this message

From: Ron Parker
Subject: Re: Intersection test for triangles
Date: 24 May 2000 18:32:38
Message: <slrn8iomr3.47a.ron.parker@linux.parkerr.fwi.com>
On Wed, 24 May 2000 17:22:30 -0500, David Fontaine wrote:
>and if the faces don't intersect the cubes don't. For the bowl-full-o-cubes
>thing...)

Not necessarily true, unless all the cubes are the same size.

If you're intersecting cubes, and they're all the same size, and they're 
axis-aligned, it suffices to check whether any corner of either cube is 
inside the other cube.  If they're not axis-aligned but still the same
size, you can check whether any edge of one cube intersects a face of the 
other cube.  (Likewise, to see if two triangles intersect, it suffices to 
check whether any edge of one triangle intersects the face of the other 
triangle.)

If you're using MegaPOV, you can use trace to determine whether they 
intersect.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
These are my opinions.  I do NOT speak for the POV-Team.


Post a reply to this message

From: David Fontaine
Subject: Re: Intersection test for triangles
Date: 24 May 2000 21:26:59
Message: <392C807F.D4BB4D78@faricy.net>
Ron Parker wrote:

> Not necessarily true, unless all the cubes are the same size.

? How can two cubes intersect if their faces never do?

> If you're intersecting cubes, and they're all the same size, and they're
> axis-aligned, it suffices to check whether any corner of either cube is
> inside the other cube.  If they're not axis-aligned but still the same
> size, you can check whether any edge of one cube intersects a face of the
> other cube.  (Likewise, to see if two triangles intersect, it suffices to
> check whether any edge of one triangle intersects the face of the other
> triangle.)

<Data> I assure you the set is sufficiently randomized. </Data>

> If you're using MegaPOV, you can use trace to determine whether they
> intersect.

*opening docs*

--
David Fontaine     <dav### [at] faricynet>     ICQ 55354965
Please visit my website: http://www.faricy.net/~davidf/


Post a reply to this message

From: John VanSickle
Subject: Re: Intersection test for triangles
Date: 24 May 2000 21:54:46
Message: <392C8B5F.23367DED@erols.com>
Warp wrote:
> 
> John VanSickle <van### [at] erolscom> wrote:
> : Find the line along which the planes intersect.
> 
>   What is the equation for the intersection line of two planes?

Not an equation, but a specification.  This requires a point
(any point that lies along the desired line will do), and a vector.

I would get the vector by taking the cross-product of the normal
vectors of the two original planes.

To find the point, I would find the plane to which this vector
is normal and which contains the origin.  The place where all
three planes intersect is as good a point to use as any (it
happens to be the point on the line that is closest to the
origin).

Regards,
John
-- 
ICQ: 46085459


Post a reply to this message

From: John VanSickle
Subject: Re: Intersection test for triangles
Date: 24 May 2000 21:57:22
Message: <392C8BFD.F25444F8@erols.com>
David Fontaine wrote:
> 
> ? How can two cubes intersect if their faces never do?

If they are the same size, they can't.  If they are different sizes,
then one could be contained entirely within another.

Regards,
John
-- 
ICQ: 46085459


Post a reply to this message

From: John VanSickle
Subject: Re: Intersection test for triangles
Date: 24 May 2000 22:01:56
Message: <392C8D0D.F5D2DB81@erols.com>
Ron Parker wrote:
> 
> (Likewise, to see if two triangles intersect, it suffices to
> check whether any edge of one triangle intersects the face of the
> other triangle.)

Not quite rigorous enough.  It is possible for two edges of each
triangle to exactly intersect the corresponding edges of the other,
and whether this is counted as an intersection of the interior of the
the triangles is a matter of floating point precision.
For randomly-arranged objects, this is highly unlikely.

Regards,
John
-- 
ICQ: 46085459


Post a reply to this message

From: Pabs
Subject: Re: Intersection test for triangles
Date: 24 May 2000 22:33:30
Message: <392C9124.2A76B3D@hotmail.com>
David Fontaine wrote:

> Given the points of two triangles, how do I test for intersection?

Try this - convert each of the 3 sides of 1 triangle to rays and test
them for intersection with the other triangle

Pabs


Post a reply to this message

From: Pabs
Subject: Re: Intersection test for triangles
Date: 24 May 2000 22:38:12
Message: <392C923E.B10312FF@hotmail.com>
Sebastian Strand wrote:

> "David Fontaine" <dav### [at] faricynet> wrote in
> news:392B20F3.726230DD@faricy.net...
> > Given the points of two triangles, how do I test for intersection?
>
> Try this page:
> http://apodeline.free.fr/FAQ/CGAFAQ/CGAFAQ-6.html#ss6.22

http://apodeline.free.fr/FAQ/CGAFAQ/CGAFAQ.html
I think this page should be added to the POV-Links collecton


Post a reply to this message

From: Ken
Subject: Re: Intersection test for triangles
Date: 24 May 2000 22:51:10
Message: <392C9401.CC7161CD@pacbell.net>
Pabs wrote:

> http://apodeline.free.fr/FAQ/CGAFAQ/CGAFAQ.html
> I think this page should be added to the POV-Links collecton

Got it already - twice!  :~)

http://www.faqs.org/faqs/graphics/algorithms-faq/
http://www.exaflop.org/docs/cgafaq

-- 
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: David Fontaine
Subject: Re: Intersection test for triangles
Date: 25 May 2000 18:54:16
Message: <392DAE31.C51559F3@faricy.net>
John VanSickle wrote:

> > ? How can two cubes intersect if their faces never do?
>
> If they are the same size, they can't.  If they are different sizes,
> then one could be contained entirely within another.

Oh! Well, even if that was happening, it wouldn't show up ;-)

--
David Fontaine     <dav### [at] faricynet>     ICQ 55354965
Please visit my website: http://www.faricy.net/~davidf/


Post a reply to this message

<<< Previous 5 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.