Comments on: GJK (Gilbert–Johnson–Keerthi) http://www.codezealot.org/archives/88 Development blog and open source repository by William Bittle Sun, 13 Jul 2014 22:58:47 +0000 hourly 1 http://wordpress.org/?v=3.9.1 By: William http://www.codezealot.org/archives/88#comment-122891 Mon, 23 Jun 2014 16:39:06 +0000 http://www.codezealot.org/?p=88#comment-122891 @Sensei_When

Unfortunately, I don’t have any textbook or material references regarding defining support functions.

I’m not sure what you mean by complex, but I’m assuming shapes like cylinders, ellipsoids, and other curved or partially curved shapes. I follow some general rules:

  1. If the shape is a transformed standard shape then just apply a transform.
  2. Else if the shape has both curved and flat surfaces, try to break the support function into parts.

1a. For example, an Ellipsoid is a just a non-uniformly scaled circle. As such, we can treat an ellipsoid as a circle if we apply the right transforms and inverse transforms (for a 2D example see the getFarthestPoint method ).

1b. For example, a Capsule is just a radially expanded line segment. So we can get the farthest point in a line segment (either end) and then just add the radius along the direction to it (for a 2D example see the getFarthestPoint method ).

2. For example, a Wedge (think slice of pizza in 2D) you technically have a rectanglar box and a partial sphere. So, we can, when the given direction is not within the wedge’s arc just use an adaptation of the rectangle’s support function, and when the direction is within the arc, use the sphere’s support function (for a 2D example see the getFarthestPoint method ).

Hopefully this will give you some ideas.

William

]]>
By: Sensei_When http://www.codezealot.org/archives/88#comment-121703 Mon, 16 Jun 2014 01:56:45 +0000 http://www.codezealot.org/?p=88#comment-121703 Dear William, as I applied the GJK in 3d environment, based on the OpenCascade , following your gorgeous tutorial, I realized that defining the support function for complex solid shapes is the most difficult problem I have to deal with. For I’m working on designing the continuous collision detection module for a CAD platform.
Would you please give me some advice or recommend some textbook or materials to me? Thanks a lot!

]]>
By: Anonymous http://www.codezealot.org/archives/88#comment-121330 Mon, 09 Jun 2014 23:01:12 +0000 http://www.codezealot.org/?p=88#comment-121330 […] […]

]]>
By: GJK Algorithm Collision Detection 2D in C# http://www.codezealot.org/archives/88#comment-120096 Fri, 16 May 2014 21:16:51 +0000 http://www.codezealot.org/?p=88#comment-120096 […] them. The best explanation I found on how the algorithm works is on this Video Tutorial  and on Code Zealot. However I tried code zealot code and didn’t work in some cases but I strongly recommend you […]

]]>
By: William http://www.codezealot.org/archives/88#comment-118336 Tue, 08 Apr 2014 12:37:51 +0000 http://www.codezealot.org/?p=88#comment-118336 @NL

Yeah, I can see how this could be confusing. Since the cross product is not commutative and we technically have (AC X AB) X AB then we need to use the triple product expansion:

(A X B) X C = -A(C · B) + B(C · A) = B(C · A) - A(C · B)

It’s a little hard to tell since both B and C in this case are AB. I’ve added parentheses to the triple products and added some text that shows the triple product expansion I’m using.

William

]]>
By: NL http://www.codezealot.org/archives/88#comment-118259 Mon, 07 Apr 2014 07:15:59 +0000 http://www.codezealot.org/?p=88#comment-118259 In ‘checking the simplex’ part. When you try to find in which voronoi region it lies.

]]>
By: William http://www.codezealot.org/archives/88#comment-117953 Wed, 02 Apr 2014 22:20:12 +0000 http://www.codezealot.org/?p=88#comment-117953 @NL

Which part of the post are you referring to that needs an update?

William

]]>
By: NL http://www.codezealot.org/archives/88#comment-117899 Wed, 02 Apr 2014 06:53:03 +0000 http://www.codezealot.org/?p=88#comment-117899 Hi William
its really quite simple. My data provides for both time and coordinates. I just correlate at what coordinate there is a collision with the corresponding time. Anyway, I found my mistake and now I get the same time of collision same for both algorithms. However, I have a small question about the triple product. In the post you have written to find ABPerp as ACxABxAB but shouldn’t it be ABxABxAC, as you have rightly written in the formula.
Regards & Thanks!

]]>
By: William http://www.codezealot.org/archives/88#comment-117860 Tue, 01 Apr 2014 22:42:35 +0000 http://www.codezealot.org/?p=88#comment-117860 @NL

Can you elaborate a little more on what you mean by the ‘time of collision is a little before’? If you mean the collision information (normal and depth) are different, then that’s definitely possible. What method are you using to get the collision information (sampling, EPA, collision margins, etc.)?

William

]]>
By: William http://www.codezealot.org/archives/88#comment-117859 Tue, 01 Apr 2014 22:37:15 +0000 http://www.codezealot.org/?p=88#comment-117859 @Fluorescence

Checkout these papers:

William

]]>