So what is the fastest way to get the closest point on a line segment? Right
now its find the closest point and then check if it's on the segment. If not
then that point is made equal to whichever end point.
So to see if its on the segment we compare the unit vectors first to see if
they're equivalent. Can this be avoided? Thank you.
On Sun, Jul 27, 2008 at 12:03 AM, Marten Svanfeldt (dev) <
[EMAIL PROTECTED]> wrote:
> No you cannot. If you really need unit vector you need to divide by
> square root. Question is, do you need unit vectors? (often you don't).
>
> -Marten
>
> Amir Taaki wrote:
> > hey thanks and that's not the problem- to convert them to unit vectors
> > you have to divide the vector by it's length- that's the potential
> > square root I wish to avoid.
> >
> > I need to add more words to my posts instead of imagining I'm a telepath.
> >
> > On Sat, Jul 26, 2008 at 8:43 PM, res <[EMAIL PROTECTED]> wrote:
> >
> > On 26.07.2008 19:46, Amir Taaki wrote:
> >
> > Hi!
> >
> > Since this calculate potentially gets done very many times per
> > frame, I'd like to minimise the heaviness of it- what's fastest
> > way to tell if point C lies between A-B?
> >
> > c = C - A
> >
> > I'd do c^ = AB^ (when unit vectors) and if |c| < |AB|
> >
> > But is it possible to avoid the square root in converting them
> > to unit vectors, possibly by some other method? Thanks
> >
> >
> > Just skip it. When comparing distances it doesn't matter if you just
> > compare the sum of squares with or without rooting it.
> >
> > -f.r.
> >
> >
> >
> -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's
> > challenge
> > Build the coolest Linux based applications with Moblin SDK & win
> > great prizes
> > Grand prize is a trip for two to an Open Source event anywhere in
> > the world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > <http://moblin-contest.org/redirect.php?banner_id=100&url=/>
> > _______________________________________________
> > Crystal-main mailing list
> > [email protected]
> > <mailto:[email protected]>
> > https://lists.sourceforge.net/lists/listinfo/crystal-main
> > Unsubscribe: mailto:[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]
> >?subject=unsubscribe
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> > Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the
> world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Crystal-main mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/crystal-main
> > Unsubscribe: mailto:[EMAIL PROTECTED]
> ?subject=unsubscribe
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Crystal-main mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/crystal-main
> Unsubscribe: mailto:[EMAIL PROTECTED]
> ?subject=unsubscribe
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]