is within ... polygon shape?

MisterX b.xavier at internet.lu
Fri Jun 24 10:57:42 EDT 2005


you need a real algotithm. The "within" function only works on 
rects only AFAIK. But the graphic will only detect a mouseup if 
you click on its graphic, not the rect - so somehow, it's "calculated"...

There's plenty of them algorithms on the net.
search "region intersection and/or polygon intersection"

fun stuff...
im sure there's a Gauss or old greek technique for this!

or... the xtalk way

you can simulate a click at any point and if the target is 
the card or not the graphic, then you got your intersection 
logic running.

i'll see what i can dig up tonite... interesting problem:

is point in *space(f) of f(i) where i is any graphic def.

oh and, new bugz 2934 found! Duh! Then people i dont check on my
bugs but hey, i dont charge as much ;)

cheers
Xavier

> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> Steve Bonham
> Sent: Friday, June 24, 2005 16:31
> To: How to use Revolution
> Subject: Re: is within ... polygon shape?
> 
> hmmmm-
> 
> Intersect doesn't work after all. It appears that one object 
> will intersect with another irregular object's rect and NOT 
> the objects true shape (polygon points).
> See illustration... at:
> 	http://academics.georgiasouthern.edu/cet/SB/ball_fairway.jpg
> 
> Is there a way to get Rev to:
> 1. evaluate IF the loc of an object is within the shape 
> (defined by a series of coordinates) of an object?
> 
> OR
> 2. evaluate IF the loc of an object intersects with the shape 
> (defined by a series of coordinates) of an object?
> 
> Thx,
> S
> 
> 
> 
> >Answered my own question- I found the "intersect" function 
> and it works 
> >(see below)
> >
> >if intersect(graphic "ball", graphic "sand1") then
> >         put "in the bunker"  into YourLie
> >       end if
> >
> >HOWEVER...
> >
> >There are many, many objects that the ball object may 
> intersect with...
> >Is it possible to use a "wildcard" character in Rev?
> >
> >For instance, there are 3 sand bunkers (sand1, sand2, sand3) and 60+ 
> >trees (tree1, tree2, etc)
> >
> >Can I use something along the lines of :
> >
> >if intersect(graphic "ball", graphic "tree" & *) then
> >         put "in the bunker"  into YourLie
> >       end if
> >
> >I'm supposing this is not possible (but it sounds like a logical
> >need)-- but maybe there is another way to accomplish this?
> >
> >Thx
> >S
> 
> -- 
> 
> 
> --------------------------------------------------------------
> ------------------------------------
> Steve Bonham
> Director, Faculty Technology Development Laboratory Center 
> for Excellence in Teaching - Georgia Southern University 
> Statesboro, GA 30460-8143
> --------------------------------------------------------------
> ------------------------------------
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage 
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 



More information about the use-livecode mailing list