is within ... polygon shape?

Jim Hurley jhurley at infostations.com
Fri Jun 24 13:09:15 EDT 2005


>
>Message: 7
>Date: Fri, 24 Jun 2005 09:37:56 -0700
>From: Scott Rossi <scott at tactilemedia.com>
>Subject: Re: is within ... polygon shape?
>To: How to use Revolution <use-revolution at lists.runrev.com>
>Message-ID: <BEE184F4.1AEAA%scott at tactilemedia.com>
>Content-Type: text/plain; charset="US-ASCII"
>
>Recently, Lynch, Jonathan  wrote:
>
>>>  Using the within() function it is possible to accurately detect
>>>  whether a point falls within the image since Rev will evaluate a
>>>  point falling within the transparent region of the image as false.
>
>  > But - would this work 100% for curved polygons or images?
>
>It works reliably with images as long as the transparent regions of the
>image are 100% transparent.  Try it.
>
>Routines for polygons should work reliably as well.
>
>(Although Jim's routine seems to work only for intersecting edges, and not
>when a smaller polygon falls *completely* within a larger polygon -- any
>tweak available Jim?)
>
>Regards,
>
>Scott Rossi
>Creative Director
>Tactile Media, Multimedia & Design


Scott,

I don't understand what you mean when you say it fails with large polygons.

In the stack below, it doesn't seem to make any difference how large 
the polygons are. I can't image why Rev would fail to recognize when 
a point is within a polygon.

go stack url "http://home.infostations.net/jhurley/CollidingPolygons.rev"

Jim




More information about the use-livecode mailing list