# compute contact of OBB intersection

This topic is 3790 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, I've implemented the 15 tests of the separate axis theorem. That's ok. I've calculated too, the point where the contact is (computing the closest point): ( for each point of the other OBB: dot with the 3 unit vector of the axis of the OBB, clamp if greater than the box extents, and the closest point is the sum of the 3 dot products multiplied by the corresponding unit vector of the axis ) But I wonder about determining the normal of the contact: How to determinate which face of the OBB contain this point ? (determining too, if it is a vertex-face (the vertex is near 1 face), an edge-face(the vertex is near 2 faces), or a vertex-vertex (..3...) contact) - angle between center and this point - distance from the face, when computing which face is colliding thanks

##### Share on other sites
The contact point generation for two boxes works like this:

You test all potential separating axes and find the axis of minimum penetration. If this axis comes from a face you define this to be your reference face. Next you find the incident face to the reference face on the other shape and clip this against the *side* planes of the reference face. Finally keep contact points "below" the reference face. If the axis of minimum penetration is an edge combination you compute the closest points between the two edge segments.

An implementation of this can be found e.g. in the ODE. Look for dBoxBox here. You might also want to look into Erin Catto's presentation here (or look at the Box2D_Lite code): http://www.gphysics.com/files/GDC2007_ErinCatto.zip

These are two presentations. One deals with constraint solving and the other with contact point generation. It is in 2D, but the face cases can easily be translated to 3D. To get you started you can consider to ignore the edge cases first. For simple stacks or just a box that drops on a plane this is sufficient.

##### Share on other sites
based on something similar. The SAT will give you the normal of collision, as well as teh depth (for an intersection test).

With the normal, you find teh support points on the two boxes. could be a face, a vertex or an edge.

then you need to compute the 'intersection' between the two features (edge vs face, face vs face, vertex vs face, edge vs edge...), using common sense and a 3D clipping algorithm.

1. 1
2. 2
Rutin
25
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 22
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631764
• Total Posts
3002209
×