is within ... polygon shape?

Alex Tweedly alex at tweedly.net
Sun Jun 26 07:59:06 EDT 2005


Jim Hurley wrote:

>
> Alex,
>
> Your ascii figures didn't translate very well in my email app.
>
Sorry. The first figure was (as I think you guessed) a "+" with one 
shape being the upright and the other being the cross-bar - so neither 
has vertices within the other shape.

> But I think I understand the first diagram, it represent a somewhat 
> different problem from the collision problem. It would not be possible 
> to achieve this configuration without one or more apexes entering the 
> other polygon.
>
Only in the case you know the initial conditions are such that all 
shapes are non-overlapping, and you need to detect the start of an 
overlap. That's often not the case, and wasn't part of Stephen's 
original problem description on this list.

And even then, drag events (or move events for "sprite"-like shapes) do 
not occur for every pixel - a quick test showed that you get deltas of 
10 or more pixels on drag events, so it's not hard for a vertex to cross 
all the way over a shape in that time, while the shapes remain 
overlapped for much longer.

> What you say is quite true if the problem is to detect any overlapping 
> area not just a collision. Messy. Even worse, grubby.

I'd hate to write a game (or any other app) that didn't detect 
collisions if you moved the mouse too fast - so I think this is the 
problem that needs to be solved for a high-quality app.

-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.1/28 - Release Date: 24/06/2005




More information about the use-livecode mailing list