Polygon geometry - any suggestions?

View: New views
3 Messages — Rating Filter:   Alert me  

Polygon geometry - any suggestions?

by david bovill :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am working with maps and geo-tagging media files - as part of this I need
to work out if a point is within an area - simplest case a polygon, but this
could be a simple volume - that is a polygon extruded to the ground.

The coordinates are latitude and longitude in degrees - with heights in
metres - so a 3D point looks like:

-0.1055509873752101,51.56310290997875,23


and a simple volume based on a polygon (23 metres high) extruded to the
ground looks like this:

-0.1055509873752101,51.56310290997875,23
-0.1057556880140851,51.56295803562467,23
-0.1056108205764588,51.56284448695596,23
-0.1055509873752101,51.56310290997875,23

The question is how to determine if a point is within this polygon / volume.
What approach to take? has anyone done this before in Rev?

Ideally there would be a simple algorithm - but so far I can't find one - so
a basic hack would be to translate the geometry to screen based pixels and
construct Rev polygons and then use the built in within(object, point)
function? Not the fastest and definitely hacky - any suggestions regarding a
better way?
_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Polygon geometry - any suggestions?

by Colin Holgate :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Don't know if this would work out for you, but you can have a simple  
image that you check the color of pixels to tell where you are. I used  
that method in this thing I did:

http://staff.funnygarbage.com/colin/track/track.mov

The stack is here:

http://staff.funnygarbage.com/colin/track.rev.zip

Once we did a golf game, where you had to hit the ball onto various  
greens (using perspective 3D), and by checking the color of the pixel  
you landed on it was possible to know whether you were on a green, and  
on which one, even if the areas were broken up into multiple strange  
shaped blobs.


_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Polygon geometry - any suggestions?

by david bovill :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Interesting idea - would be more flexible and powerful too. Still I'd rather
do simple text based geometry as eventually this should be a CGI? This is
the only one I've found so far - does my head in to look at it :)

   - Within Polygon
Algorithm<http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html#The%20Method>
_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution