Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 24-02-2009
Member
 
Join Date: Jan 2009
Posts: 57
Separating Axis Theorem

hi there

I am facing some rpoblem in a theorem. I have searched a lot for a real, decent, sensitive explanation regarding the Separating Axis Theorem, and I am unable to find anything which makes any sense. I also can't visualize what the search talks about.

I want to detect and extract some information from a collision between two Orientated Boxes.
Reply With Quote
  #2  
Old 24-02-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Separating Axis Theorem

For objects lying in a plane (2-dimensional space), the separating axis theorem states that the projection of two convex shapes onto some line will be separate if and only if they are not intersecting. The line for which the objects have disjoint projections is called the separating axis. An equivalent way of stating the theorem is to say that two convex shapes in the plane are not intersecting if and only if a line can be placed with one shape to one side of the line and the other side. Such a separating line will be perpendicular to the separating axis.

For three-dimensional space, an axis can be found where the projection of two convex shapes can be separated if and only if they are not intersecting. In 3D, lines and planes are duals, and you can thus turn the separating axis theorem for 3D into the separating plane theorem. The general result in n dimensions is called the separating hyperplane theorem.
Reply With Quote
  #3  
Old 24-02-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: Separating Axis Theorem

The first thing you have to understand is how to project objects onto a line (an axis) in space. You can imagine this, visually, by placing a spotlight directly over the objects and watching where their "shadows" would fall on the line. (The virtual spotlight should be oriented so that it shines directly onto the line; its light rays should be perpendicular to the line) The shadows are the projection of these objects on the line.

If you don't know how to mathematically find the projection of one vector onto another, then you should take a course or read a book on vector math, dot and cross products, etc. I'll assume you know how to do this.

Anyway, imagine two boxes in quadrant I of a 2D space. Let's use the x-axis as our "line" for simplicity's sake. Now imagine the projection of these boxes onto the line. If the projections don't overlap (you have two distinct projections with some separating region between them), then the boxes cannot be colliding and you have found the "separating axis". If they were colliding in any way, then the shadows/projections would overlap.

Keep in mind that if the shadows/projections DO overlap, that doesn't mean that the boxes are colliding. It just means you can't tell yet. You have to try another axis. Try the y-axis. Still overlapping? How about the line formed by one of the box-edges? The Gottschalk paper describes the minimum number of such tests required to find a separating axis. If you exaust all of those tests and still can't find a separating axis, then the boxes must be colliding.

In 3D, the same analogy applies. Imagine the shadows of the boxes on some arbitrary plane (since we've added a dimension, we're looking for a separating plane now). If they don't overlap, then you know the boxes can't be touching each other. If they do, then you have to try another plane.

Ultimately, it turns out you have to try, at most, 15 such tests before you can be sure that the boxes are colliding. The paper describes a lot of simplification in the math that makes these tests a lot faster computationally. I also think it does a great job explaining it.
Reply With Quote
  #4  
Old 24-02-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Separating Axis Theorem

Used in Collision Detection:

The theorem does not apply if one of the bodies is not convex.

The separating axis theorem says that if two convex objects are not penetrating, there exists an axis for which the projection of the objects will not overlap. This is an important definition, because it suggests an algorithm for testing whether two convex solids intersect or not -- and, in fact, it's heavily used in computational geometry, including computer games. It is also an important definition, because no matter what the dimensionality, the separating axis is always an axis. For example, in 3D, there is still a separating axis. That axis is the dual of a separating plane.

The separating axis theorem can be applied for fast collision detection between polygon meshes. Each face's normal or other feature directions is used as a separating axis, as well as the cross products. Note that this yields possible separating axes, not separating lines/planes.

If the cross products were not used, certain edge-on-edge non-colliding cases would be treated as colliding. For increased efficiency, parallel axes may be calculated as a single axis.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Separating Axis Theorem"
Thread Thread Starter Forum Replies Last Post
Do you like Yahoo Axis or Not T.Y.K Polls & Voting 6 29-05-2012 01:25 PM
X axis is faster than Y axis moves in Risen 2: Dark Waters Karna@42 Video Games 1 12-05-2012 01:16 PM
Excitation for the Tetris axis 3DS Lol$prakash Video Games 1 08-10-2011 09:50 AM
Screen Separating on Toshiba Thrive Tablet Tam^bura Portable Devices 6 02-08-2011 08:23 PM
Separating a string in java Aaliya Seth Software Development 5 10-02-2010 04:27 AM


All times are GMT +5.5. The time now is 06:36 AM.