It is currently Mon Dec 09, 2013 9:09 am

 All times are UTC

 Page 1 of 1 [ 3 posts ]
 Print view | E-mail friend Previous topic | Next topic
Author Message
 Post subject: polygon collision articlePosted: Fri Sep 07, 2012 3:52 am
On page http://content.gpwiki.org/index.php/Polygon_Collision there is some, probably, wrong info. In section about non-convex objects described algorithm, which suggests to perform point-in-polygon test for each vertex of another polygon. But if we find that no vertex lies inside polygon, it means nothing. For example, take a look at character '+'. Plus consists of two axes-oriented boxes (polygons). Every vertex is outside boxes. But polygons collides.

This algorithm will work correctly under some conditions: if we check for collision every STEP seconds, we know that at STEP seconds before now polygons didnt collides, and we know that maximum speed of any object multiplied by 2*STEP is lower then minimum "width" of object. "Width" in this context needs separate definition, but I'm not strong in English, and I think that my attempts to define this will not give you a clearer undestanding but, on the contrary, will perplex you. =)

If we needs some extremly simple, but always giving true results, then we need to check for collision each pair e1, e2, where e1 some is edge of polygon #1, and e2 is edge of polygon #2. But this is not so fast. This approach have O(m*n) complexity, where m and n are numbers of vertices of polygons.

Top

 Post subject: Re: polygon collision articlePosted: Fri Sep 07, 2012 8:23 am
 Bibliotherapist

Joined: Wed Nov 03, 2004 1:28 pm
Posts: 6881
Location: Wilts, Englandshire
Hi there, welcome to GPWiki.

The bulk of that article was written back in 2009. I must admit I've never read it in any depth as I've never had a need to do that kind of work. If you want to correct the text, drop me a PM and I'll create a wiki account for you (our registrations are locked down due to spam).

_________________
20 GOTO 10

Top

 Post subject: Re: polygon collision articlePosted: Fri Sep 07, 2012 5:21 pm
 Cubic Contributor

Joined: Sun May 27, 2012 6:01 pm
Posts: 66
The article says that point in polygon should be used as a preliminary test as it is fast and provides additional information. It does go on to say to use edge detection and provides a code example of edge collision.

What is it you think is wrong with it?

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 1 guest

 You can post new topics in this forumYou can reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forum

Search for:
 Jump to:  Select a forum ------------------ Forums    Forum Rules and Posting Guidelines Wiki Discussion    Help    Content Issues Game Programming Discussion    C and C++ Game Programming    Java Game Programming    Language Agnostic Programming    .NET Game Programming    VB Game Programming    Mobile Game Programming    Web-Based Game Programming    Other Languages    OpenGL Development    Direct X Development Game Development Discussion    Game Design    Game Media Off-Topic Discussion    Announcements    Off-Topic    Community Projects    News