Members - Reputation: 145
Posted 30 September 2005 - 09:41 AM
Posted 30 September 2005 - 12:00 PM
When they talk about finding the smallest simplex or whatever, they are just trying to state in very non-ambiguous mathematical terms that you choose the points that form the simplex that contains the point closest to the origin. So that would be the triangle which contains the point closest to the origin.
There's no need to start with any points in the simplex at all. You can just start with an empty set of points for the simplex, and keep adding new points to it until it gets to the size where you need to calculate which point to remove at each iteration.
You can initialize the algorithm by choosing an arbitrary direction. That direction gives you the first point, then the next direction is opposite the vector between the origin and the point. That direction produces the second point. Now the simplex is a line, and you find the closest point to the origin on that line, choose the next direction by negating the vector to that point, and that produces the third point. Now you find the closest point on the triangle to the origin, then negate that vector to get the next direction and the fourth point. At this point the simplex contains 4 points, but a subset of that simplex consisting of a simplex of only 3 of the points will contain the point closest to the origin. So you eliminate the point that is not part of that triangle. Then any more iterations look just like the last one...
Members - Reputation: 835
Posted 30 September 2005 - 06:10 PM
Quote:A frequent approach is to start with the simplex from the previous call to the algorithm (for the given pair of objects). The first time around just use one point.
Original post by Gorwooken
Also what is the best way to init a simplex in R3, should I just start with one point and begin the algorithm?
Quote:Yes, you drop the points in the support set that are not needed to express the point that lies on the feature and is closest to the query point. For example, you have four points in the set, forming a tetrahedron. If the closest point lies on one of the faces of the tetrahedron, you keep the three vertices of that face and discard the fourth. If the closest point lies on one of the tetrahedron edges, you keep the pair of points determining the edge and discard the other two. Et cetera.
say I had a tetrahedron simplex and i wanted to reduce the simplex when i calculate the closest point to the origin on the tetrahedron, say the point lies on a face of the tetrahedron, would the simplex simply be the triangle that the point lies on?
Moderators - Reputation: 10198
Posted 30 September 2005 - 06:26 PM
The objects i'm working with are convex
If you find GJK to be too much trouble for convex objects, you can use SAT, or a host of other, possibly more optimal, solutions for convex/convex testing. You probably already know that, but I figured I'd mention it.
Members - Reputation: 145
Posted 30 September 2005 - 10:47 PM
hplus0603, I've already got an implementation of the SAT for use with my Oriented Bounding Box Tree class. Thus far I'm quickly able to calculate if two objects are intersecting and i'm in the process of implementing GJK for determination of the penetration distance when two convex polyhedra collide