Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Gaming > Development Programming Algorithms > Re: fast algori...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 11 Topic 669 of 680
Post > Topic >>

Re: fast algorithm for detecting all Intersections of multiple

by Geoffrey Summerhayes <sumrnot@[EMAIL PROTECTED] > Apr 2, 2008 at 12:04 PM

On Apr 2, 2:08=A0pm, IsaacKuo <mech...@[EMAIL PROTECTED]
> wrote:
> On Apr 2, 12:50=A0pm, Geoffrey Summerhayes <sumr...@[EMAIL PROTECTED]
> wrote:
> > On Apr 2, 12:25=A0pm, IsaacKuo <mech...@[EMAIL PROTECTED]
> wrote:
> > >
> > > However, Bentley-Ottmann is a good start. =A0First, you use Bentley-
> > > Ottmann
> > > while ignoring the Z dimension to determine candidate intersections.
> > > Then
> > > you calculate the distance between the lines of the candidates to
> > > determine
> > > whether they are "close enough".
> > > The distance between two line segments is calculated by first
> > > determining the unit normal. =A0Do this by calculating the cross
> > > product of the line segment vectors, and normalize to a length
> > > of one. =A0This gives you a unit vector which is perpendicular to
> > > both of the line segments. =A0Then, take the difference between
> > > two points of either line (i.e. take either endpoint of each line
> > > segment), and dot product it with that unit normal. =A0The
> > > absolute value of this dot product is the distance between the
> > > two lines. =A0If that value is less then "epsilon", your arbitrary
> > > value for "close enough", then the line segments intersect.
> >
> > Actually, since you have a possible point of intersection
> > (x-y) wouldn't it be simpler to determine the z on both
> > lines at that point and compare the difference to epsilon?
> > If they do intersect, it has to occur at that point.
>
> That's a possibility, but it's has more aliasing effects. =A0By
> calculating the true distance, you're essentially looking for
> intersections between cylinders. =A0There very tips of the
> cylinders are chopped off in a way which isn't symmetric,
> but that's a pretty small "error".
>
> What you suggest will make the critical distance sensitive
> to line segment alignment. =A0For line segments which are
> mostly parallel to the XY plane, then the segments need
> to be closer than epsilon. =A0But if a line segment is angled
> at theta from the Z axis, then the critical distance is
> epsilon/sin(theta).
>
> Depending on the application, that might mean an artificially
> low number of intersections with line segments that are
> mostly aligned to the Z axis and/or an artificially high number
> of intersections with line segments that are roughly parallel
> to the XY plane.
>

Ok, I'll admit that, hadn't really thought that all the
way through. Might make an early acceptance test, but I'm
not sure if it would save any processing time.

> > The only problem is that Bentley-Ottmann doesn't really
> > work in 3d. Unlike 2d, it's possible for the 'above' and
> > 'below' lines not to intersect, but still have others that
> > do, so you can't reject it during the search.
> > So the only way I can see of using the algorithm, is to
> > keep all the possible intersections during the xy pass
> > and run through the points and the lines that intersected
> > there and check the z afterwards.
>
> Right, with the caveat that checking for 3d intersections
> afterward may not be so obvious. =A0It's going to depend on
> exactly what you're doing with the results.

Depends a lot on the input data too, I can think of some
degenerate cases where AABB + line-to-line testing would
come out on top.

----
Geoff
 




 11 Posts in Topic:
fast algorithm for detecting all Intersections of multiple lines
"Jens Hilwig" &  2008-04-02 12:03:45 
Re: fast algorithm for detecting all Intersections of multiple l
Miss Elaine Eos <Misc@  2008-04-02 15:15:02 
Re: fast algorithm for detecting all Intersections of multiple
IsaacKuo <mechdan@[EMA  2008-04-02 09:25:05 
Re: fast algorithm for detecting all Intersections of multiple
Geoffrey Summerhayes <  2008-04-02 10:50:19 
Re: fast algorithm for detecting all Intersections of multiple
IsaacKuo <mechdan@[EMA  2008-04-02 11:08:11 
Re: fast algorithm for detecting all Intersections of multiple
Geoffrey Summerhayes <  2008-04-02 12:04:50 
Re: fast algorithm for detecting all Intersections of multiple l
John Nagle <nagle@[EMA  2008-04-03 23:33:11 
Re: fast algorithm for detecting all Intersections of multiple l
"Jens Hilwig" &  2008-04-04 09:25:41 
Re: fast algorithm for detecting all Intersections of multiple l
John Nagle <nagle@[EMA  2008-04-09 17:49:22 
Re: fast algorithm for detecting all Intersections of multiple
IsaacKuo <mechdan@[EMA  2008-04-04 07:14:42 
Re: fast algorithm for detecting all Intersections of multiple l
Miss Elaine Eos <Misc@  2008-04-04 14:49:51 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 2:06:53 CDT 2008.