Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 03 August 2011 - 02:49 PM
Posted 03 August 2011 - 03:54 PM
Posted 03 August 2011 - 05:00 PM
It sounds like using a portion of Minkowski Portal Refinement/XenoCollide would get you what you want.
The core of the algorithm is basically a ray cast from inside the minkowski difference to the surface in some given direction. For intersection queries, it checks to see if the ray hits the surface or the origin first. Adapting it to find penetration depths in arbitrary directions by casting from the origin is pretty simple.
Posted 03 August 2011 - 05:30 PM
Posted 03 August 2011 - 06:03 PM
MPR works on the extreme points of objects, just like GJK. The general idea of a surface cast in MPR is that you create a triangle from support maps through which the ray passes, then incrementally refine that triangle until you reach the surface.
The incremental refinement process finds the extreme point along the current triangle's normal. That point, combined with the three vertices of the previous triangle, forms three new triangles. The outer face of that tetrahedron which contains the ray is picked as the new triangle, and the process continues.
A more detailed explanation can be found in the Game Programming Gems 7 book where XenoCollide was published. The XenoCollide website also has some code samples I believe. Some other open source engines have implementations that you could look at too (including mine, BEPUphysics).
Adapting it to find penetration depths in arbitrary directions by casting from the origin is pretty simple.
Posted 03 August 2011 - 06:48 PM
That distance is obtained from the process I described in my previous post.
The triangle ("portal") is refined until it reaches the surface. Once you find the surface, you have a plane (from the portal) and a ray. Intersect the ray with that plane.
Posted 03 August 2011 - 07:01 PM
That will not work in general. Consider this 2d example:well i figure if i know the direction im casting, i can find the plane by seaching for the 3 points on the minkowski difference farthest in the direction.
It's just a regular old geometry test. Googling ray-plane intersection or line-plane intersection should come up with plenty of resources.I guess what im asking is how do i intersect the ray with that plane.
Posted 04 August 2011 - 03:24 PM
That will not work in general. Consider this 2d example:well i figure if i know the direction im casting, i can find the plane by seaching for the 3 points on the minkowski difference farthest in the direction.
It's just a regular old geometry test. Googling ray-plane intersection or line-plane intersection should come up with plenty of resources.I guess what im asking is how do i intersect the ray with that plane.
Posted 04 August 2011 - 09:35 PM
Yes, the GJK test can be used to determine the containment of the origin.can i use my boolean GJK test to first determine whether a intersection has occuredand then go about ray casting and determining the plane that will be intersected?
Do i have to use an MPR implementation?
Is there a way to find which plane it would be intersecting wittout MPR?
Posted 05 August 2011 - 12:02 AM
Posted 12 August 2011 - 09:11 AM
Posted 15 August 2011 - 04:11 PM
Is this in 2d?
If so, I would just compute the full minkowski difference and have done with it - it will end up being faster and more robust in the long run
http://www.wildbunny...on-for-dummies/
Cheers, Paul.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.